appium: Can not found a photo using simulator iOS
The problem
I am trying to choose a photo form photo gallery. After clicking on the app, that i am testing, choose photo pop up the following screen with the following inspector
By running the server i have got the following: An element could not be located on the page using the given search parameters.
Environment
- Appium version (or git revision) that exhibits the issue: 1.17.0
- Mobile platform/version under test: Mac
- Real device or emulator/simulator: simulator
- Appium CLI or Appium.app|exe:
Code To Reproduce Issue [ Good To Have ]
getIOSDriver().findElementByXPath("//XCUIElementTypeCell[@name=\"Alle Fotos\"]").click();
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18
No, the locator must be a valid ios predicate. Read https://github.com/appium/appium/blob/fe293dcaf4621ae68f4d61f891b872442f7627bc/docs/en/writing-running-appium/ios/ios-predicate.md
https://kapeli.com/cheat_sheets/NSPredicate.docset/Contents/Resources/Documents/index for more details
This depends on how the app under test is built. I cannot reproduce the issue locally with my app under test - all elements on the Photos overlay are found properly.
Try to retrieve the page source right before the lookup is executed and check what’s there.