How can get only the window elements and exclude the OpenQA.Selenium.Appium.AppiumWebElement elements from a list ?
See original GitHub issueI’m facing a problem when I want to retrieve some elements form inside a parent element
var buttonsElements = driver.Current.FindElementByClassName("FullPrintPrescriptionsView").FindElementsByClassName("Button");
I expect to return only 4 buttons , but 48 OpenQA.Selenium.Appium.AppiumWebElement buttons are retrieved
I want to retrieve only the buttons elements
Issue Analytics
- State:
- Created 2 years ago
- Comments:7
Top Results From Across the Web
Appium Windows Application Testing only finds elements ...
When I am running my tests with the application closed to start, it can't find any of the elements I'm asserting. When I...
Read more >How can I fetch all elements from a screen automatically
Hi, I am trying to implement a solution where it is possible to automate the elements attributes automatically, but there is no success...
Read more >Working with select list elements
First locate a <select> element, then use it to initialize a Select object. Note that as of Selenium 4.5, you can't create a...
Read more >WebDriver
Provided is a set of interfaces to discover and manipulate DOM elements in web documents and to control the behavior of a user...
Read more >Appium finding an element that need to be scrolled into view
I am testing a mobile application using Appium + Selenium + Java. I have a page who contains several elements with the following...
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
@zahraazezo I think
FindElementsByClassName("Button");
finds elements in whole page. It is not finding element insideFindElementByClassName("FullPrintPrescriptionsView")
.To confirm this behaviour, you may try to find elements by
driver.Current.FindElementsByXPath("//*[@ClassName='Button']")
. It is also expected to return 48 elements.I am using xpaths only in my project, and I don’t feel any slowness as compared to other selectors. I am using winappdriver 1.2-RC.
@zahraazezo Can you expand all tree? I’m not sure, but your FullPrintPrescriptionsView has some ‘custom’ childs and FindElementByClassName returns all buttons that were found in the tree, not only for the first level… And by using xpath you are saying on which level you have to find them. Looks like you have more buttons deeper