I am trying to read distance value from ‘Distance by Land Transport’ field from the site ( https://www.freemaptools.com/distance-between-canada-postcodes.htm) but I am getting nothing though the calculated distance value is displaying in the field. Below is my code and the site used. Questions: why I am getting nothing? ( please see below code String variable: strDist shows nothing) Interestingly, when I
Tag: selenium
How to re run suite without using listener in testng
I had a requirement to re-run a complete suite from the TestNG test method itself if any of the test-case from the suite failed. Is there any way to call complete suite using an XML file or Test class within the Test method? The complete suite should re-run the after-class method or teardown test-case or last test-case @AfterClass or @AfterMethod
Reach for the deep nested element using Selenium WebDriver (Java)
I looked through a lot of topics on Stackoverflow and tried several recommendations but could hardly succeed in resolving my particular case. I’m trying to automate Google Cloud Pricing Calculator using Selenium WebDriver + Java. I need insert the Number of instances (the first input area on the page) using Java code. My Java code is following: But NoSuchElementException is
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
How to add Java doc link in Eclipse for selenium 3.141.59
I have added selenium 3.141.59 to my project in Eclipse IDE. There are 7 jar files in selenium’s latest release. I tried to add Javadoc link – https://www.selenium.dev/selenium/docs/api/java/overview-summary.html in each jar file of selenium. But the Eclipse editor is not showing any documentation when hover over the selenium method. Can anyone please help me to solve this problem? Answer You
How I can select an element from a dropdown list?
Problem: I try to select an element from a dropdown list I have a dropdown list with the following HTML code: I try to select the element with the following Java code but didn’t work: How I can select the element,I tried to increase the time in Wait, I also tried with Thread.sleep () but it still doesn’t recognize the
The following error java.lang.NullPointerException is displayed after run the project
Problem: My classes are Hooks for setup and test. I try to click on cookie pop-up, using WebdriverWait, but don’t work. I have no idea why. I am a beginner with selenium and automation testing and I am writing a selenium script using java, TestNG, and maven. When I write everything in one class, all works fine, but I want
How to pass input to multi element text box which is varying dynamically using selenium with java
I have one page where it has single text box, same page we have link called “create account”. When I click “create account”, page will be added with one more text box(i.e now text box count go to 2, next click 3 text box, next click 4 text box, etc). So whenever we click “create account” text box will be
Selenium Issue When Having tabular data in the form of DIV on a website where inside a DIV I have one div for every row
While writing Selenium automation test for a website having number of rows in the form of DIV inside one DIV. every row denotes one DIV. suppose dynamically if I have 5 rows then following code structure is there. I am fetching each row div/table/tr/td using XPath in for loop in my code and clicking on each. So that I can
Two loops for into stream
I have some String method with two for and if: And I still try to change this implementation to some stream. Is it possible in this case? I’ve tried many options, but I have a problem with indexing (index++;) and then with filter in tableCells By.tagname. I think that is it not possible to change that full method to stream,