Reputation: 51
In my application i wanna count number of elements pressent in on div using appium 1.7.1 for ios
Example in my application room wise i wanna count in one room how many switches are pressent
Upvotes: 1
Views: 1948
Reputation: 51
I can able to count number of switches in one room.. Below code is working fine for me
TouchAction touch1 = new TouchAction(driver);
touch1.tap (80, 300).perform();
List optionCount =driver.findElementsByClassName("XCUIElementTypeImage");
System.out.println(optionCount.size()-1); Blockquote
Upvotes: 1
Reputation: 4559
You're going to want to use findElements, which will you return you a list of all elements matching your query. You'll then use standard Java to grab the number of elements in the list.
Usage examples: http://toolsqa.com/selenium-webdriver/findelement-and-findelements-command/
Upvotes: 0