Skip to content
Advertisement

Tag: selenium

why nothing is returned when reading distance displayed on the site mentioned in the body using selenium webdriver

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

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

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,

Advertisement