Scenario: You are automating a mobile app, and the element you need to interact with has no unique ID or name. How would you approach this situation using XPath locators, and what considerations would you keep in mind?

  • Use relative XPath
  • Use absolute XPath
  • Combine XPath with other locators
  • Use accessibility IDs
In this scenario, you can combine XPath with other locators (like class name, text, etc.) to create a more robust and reliable XPath expression. This helps in handling dynamic changes in the app's structure while ensuring the element is correctly identified.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *