K
K
kykyryky2016-10-25 14:55:56
selenium
kykyryky, 2016-10-25 14:55:56

How to get list of div inside outer div?

All that has happened so far is to do this:

var divList = driver.FindElement(By.XPath(externalDivXpath)).FindElements(By.TagName("div")).ToList();

but if there are other divs inside those divs that lie in the outer div, then it will count them too.
How can I take only those divs that lie exactly in the outer div and not touch those that are deeper?
Classes, id are different for everyone.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Eremin, 2016-10-25
@EreminD

and you fundamentally use Xpath? stackoverflow.com/questions/8981091/xpath-select-d...
is possible in css using ">" https://developer.mozilla.org/ru/docs/Web/CSS/Chil...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question