Skip to content
Advertisement

Tag: xpath

Cannot write dynamic xpath for element in page

This is the Url: http://automationpractice.com/index.php I want to select “casual dresses”, but when I tried the “Women” WebElement is selected instead. How can I write the dyanmic xpath to select “casual dresses”? Answer You have to wait until page is loaded, then hover over Women title, the wait until the menu is open and then click on the Casual Dress

Element not clickable when using FindElement on another WebElement

I have a weird problem: When I locate an element via: I can’t click e2, because: “Element < div class=”c2″ > could not be scrolled into view.” BUT when I locate e2 via: it works. (Also when checking e2.getLocation() the coordinates are different, and only correct in the second snippet). I think Selenium doesn’t like the “//.”, because: also works.

Selenium how to get all elements inside a WebElement

I’m trying to get all the elements inside a selenium WebElement, for example: I want to get a list of all the elements inside including child elements, like so… div element header paragraph element paragraph So I’ve tried this element.findElements(By.xpath(“*”)) but this would return only element element So then I tried a recursive method to get all of the childs

Advertisement