6. How to take screenshot on failure, success or skip? Selenium + testng (Java Maven project)

Create a new project. Add abstract class TestBase. In beforeTest you need to create driver and open tested web page. In afterTest you need to tear down your web driver.

For taking screenshots we need to use @AfterMethod annotation, because we need to create screenshot after each test method. Continue reading

How to read data from excel document in Java project? Poi library in Selenium tests.

The following example shows how can we read data in specified intervals from excel file.

This article is part of previous one where you need to create maven project and add poi dependency into pom.xml file. So, you need to have some knowledge to do this example.

As example, we have two cells where we store our search data and result data.poi1

 

Continue reading

Selenium IDE

selenium-ide-logoWith Selenium IDE (integrated development environment) you can create your own simple automation scripts. Scripts may be automatically recorded and edited manually providing autocompletion. Scripts are recorded in Selenese, a special test scripting language for Selenium. Selenese provides commands for performing actions in a browser (click a link, select an option, wait, type, make assert and other). You can export your tests from Selenium IDE to Selenium RC or Selenium WebDriver tests using any languages: C#, Java, Python, Ruby.

How to download Selenium IDE?

Selenium IDE is the most simplest and easiest of all the tools within the Selenium Package.

 

Continue reading