XCUITest Element could not be found error
See original GitHub issueHi
Before XCUITest (Before IOS 10) I was using below method to find a UI Element in IOS application:
private void executeIOSAction(IOSObjects mtosElement, ActionType actionType) throws CrashException, ActionNotPossibleException
{
WebElement webElement = null;
try {
if (actionType == ActionType.CLICK) { // For finding clickable objects
if (mtosElement instanceof XCUIElementTypeButton) {
// this.turnWifiStatus(true);
logger.info("Clicking Button:" + mtosElement.getName() + " WithXPath:" + mtosElement.getPathStr());
XCUIElementTypeButton buttonElement = (XCUIElementTypeButton) mtosElement;
webElement = driver.findElement(By.xpath(buttonElement.getPathStr()));
if (webElement != null) {
webElement.click();
buttonElement.setIsClicked();
}
}
But after changing implementation to XCUITest it gives the below error. Does anyone know how can I fix that?
2016-10-13 13:46:55,318 ERROR: Web Driver Exception:An element could not be located on the page using the given search parameters. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 546 milliseconds
Path That I'm Searching: //XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeButton[1]
And this is the driver.getPageSource() output of the current Screen:
https://drive.google.com/file/d/0B3eSt3_PT8YXakQwRC1ZOHFDT2c/view?usp=sharing
Thanks
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
element could not be found selenium webdriver mobile
I keep getting the below error message. Selenium::WebDriver::Error::NoSuchElementError: An element could not be located on the page using the ...
Read more >XCTest UI "failure fetching values… | Apple Developer Forums
My UI testing has started failing when testing 2 sliders on 1 view in my application (All the other work). It's not an...
Read more >appium-xcuitest-driver - npm
Appium driver for iOS using XCUITest for backend. Latest version: 4.16.5, last published: 8 hours ago. Start using appium-xcuitest-driver in your project by ......
Read more >Why is XCUITest so Bad - Jon Gabilondo
You will find similar situations in the order of elements. Often, the order of elements as you traverse the UI Tree with the...
Read more >appium/appium - Gitter
'An element could not be located on the page using the given search parameters. ... Our hybrid app throws the error [debug] [XCUITest]...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The UI tree generated by XCTest is different from the one generated by instruments. So don’t expect same paths or class names to work for both frameworks. Most of the times it is necessary to update locators according to the actual tree. Regarding inspector - the “native” one is currently being developed. Although you can try some alternatives.
@jlipps I am unable to locate element appears on a video , though it has Accessibility ID , Label and Type provided. Please help.