No matter how i use it or where i write it i’m getting the Error that the node does not exists (Tried of many different nodes - table cells. All the cells that where not presented in the beginning cant be approached:
System.out.println(iosDriver.findElement(By.xpath("//XCUIElementTypeTable/XCUIElementTypeCell[contains(@name, 'isConnected')]")).isDisplayed());
System.out.println(iosDriver.findElement(By.xpath("//XCUIElementTypeCell[contains(@name, 'isConnected')]")).isEnabled());
iosDriver.findElement(By.xpath("//XCUIElementTypeTable/XCUIElementTypeCell[contains(@label, 'isConnected')]")).click();
org.openqa.selenium.NoSuchElementException: An element could not be located on the page using the given search parameters.
*** Element info: {Using=xpath, value=//XCUIElementTypeTable/XCUIElementTypeCell[contains(@name, ‘isConnected’)]}
The example i’ve given is only en example, i’ve tried many type of xPath strings, i just gave 3 deferent examples, all of them fails
The Scrolling code is as followed and it scrolls great but doesn’t stop when the element is displayed. Is stopes for few seconds thens then keeps on scrolling:
public static void scrolltoXPath(RemoteWebDriver driver, String xPath) {
RemoteWebElement parent = (RemoteWebElement)driver.findElement(By.className("XCUIElementTypeTable")); //identifying the parent Table
String parentID = parent.getId();
HashMap<String, String> scrollObject = new HashMap<String, String>();
scrollObject.put("element", parentID);
// Use the predicate that provides the value of the label attribute
scrollObject.put("predicateString", "label == 'isConnected'");
driver.executeScript("mobile:scroll", scrollObject); // scroll to the target element
}
10x