Skip to content
Advertisement

Tag: selenium

scrape an angularjs website with java

I need to scrape a website with content ‘inserted’ by Angular. And it needs to be done with java. I have tried Selenium Webdriver (as I have used Selenium before for scraping less dynamic webpages). But I have no idea how to deal with the Angular part. Apart from the script tags in the head section of the page, there

Best way to store locators

I’m following page object design pattern for Selenium automation and I can guess that many people store locators in .properties file and access them in code. It seems great to keep locators at separate place. Since, I haven’t work on any big project for Selenium automation, I would like to know thoughts on following so that I can avoid problems

How to download XLSX file through firefox using Selenium in Java?

I am trying to download an xlsx file using the following code: But the test stops after displaying the download dialog box, and it is not downloading any file. But if i try the same code for csv file by changing the mime type mentioned in the above code, then it works fine. Please help me. Thank you. Answer Instead

How to use if else condition for searching element using WebDriver in Selenium?

I used else if concept I have not used try catch finally concept webdriver element finding using elseif loop how I want it to work : First it will check for “if” condition that is [if(driver.findElement(By.xpath(“username”)).isDisplayed())] and if it is not found it will not print any statement. because “if” condition is not seen it will go to “elseif” condition

Can I verify that an input field is masked or shows the text?

Using Java and webdriver, I’m trying to setup a test to verify that the password I type is masked. With my tool, we have a setting that allows you to have the password masked or to show the text. I was wondering if anyone has ever verified something like this with Selenium. Here is what I want to check Setting

Selecting Nth-of-type in selenium

I’m trying to use By.cssSelector to grab the nth dom element with class c3 with a structure like this: Testing my CSS selectors, I’m becoming increasingly confused. This selector selects the 2nd instance of c2/c3 correctly: while: select nothing. Even worse, translating this into selenium, I seem to consistently find nothing for all 3 versions. There are plenty of alternative

Selecting an item from a combo box selenium driver with java

I tried to select an item from a combo box through selenium driver with java, but it didn’t work. This is my code… Answer In WebDriver there is separate Class (Select) is there to deal with Combo lists. Use below logic to select options from pick list fields Refer this post for more info regarding Select class.

Advertisement