Skip to content

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 sectio…

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 th…

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 I…

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 …

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 …

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…