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
Tag: xpath
Trying to use .replace() to replace XML dependencies extracted by using XPATH java
i have a pom xml and pom-web xml. im trying to copy the dependency from pom-web to pom.xml by extracting the dependency into a variable using Xpath and trying to do .replace in the pom.xml file with the variable. but im not able to replace the content via the variable as the if condition for .contains() is false. Any help
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.
Find index of nested XML tag
suppose I have an XML like this: foo <name&…
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
How can I use getText to capture text on lines which aren’t tagged?
I have the following web element, which looks like this when inspecting the web page element in the browser:
Your reference is &…
org.openqa.selenium.ElementClickInterceptedException: element click intercepted error using Selenium and Java in headless mode
I have a project that I am working on with java and selenium. the test work OK in UI mode. However in headless mode I get this error how can I resolve this issue (working in UI mode). this is my code why in selenium there is no operation to move to the element and break all layers. this is
How to find element with “== $0” after end tag in html using Xpath, css or any other locators in Selenium
I have to find element with “== $0” after end tag of “span”. Below is the HTML Code of element. Although while I have copied the html code it is removing “== $0” itself. so I am attaching image also. I have tried to find out solution but it was not working. I have tried xpath that normally works like
Selenium – select an input from an angularjs component
I have an AngularJs component that contains an input of type text. I have used the following code to enter a date. It fails most of the times when I run the test headless. There are a few other inputs before the datepicker that I fill in. But when the test reaches datepciker, it fails because it can not find
XPathExpression Evaluate returns an empty NodeList in java
I have tried to get value attribute from the tag: My xml is: My method for getting value in Java is: But, my NodeList: nl.getLength() is 0. Could you please help somehow? Thank you in advance. Answer You need to tell your DocumentBuilderFactory to parse namespaces: