Wednesday, 17 May 2017

Working with different browser drivers.

To work with any browser, we need the executable driver for specific browsers. Here, I will explain about 3 major browsers & their executable driver that we are using in Windows environment.
1
Mozilla Firefox
Geckodriver.exe
System.setProperty(“webdriver.gecko.driver”,”/path/to/geckodriver.exe”)
2
Chrome
Chromedriver.exe
System.setProperty(“webdriver.chrome.driver”,”/path/to/chromedriver.exe”)
3
IE
IEDriverServer.exe
System.setProperty(“webdriver.ie.driver”,”/path/to/ IEDriverServer exe”)

Downloading WebDriver jars & configuring in eclipse.

The latest version of selenium web driver is 3.x. To use Selenium 3.0x the minimum requirement is JAVA8+. If we are using Selenium 3.x then you can use Mozilla latest version. If it’s failing to load Mozilla latest version then use latest – 1 version of Mozilla.
To download web driver jars, open the selenium official site (http://www.seleniumhq.org), go to Download section, Under JAVA click on download link to download the .zip file.
Once you download the .zip file, Extract the .zip file & keep it in your workspace directory. If you open the extracted folder then you can see lib folder where all the dependency jars are present.

Tuesday, 16 May 2017

Introduction to Selenium Web Driver.

Selenium-WebDriver was developed to better support dynamic web pages where elements of a page may change without the page itself being reloaded. WebDriver’s goal is to supply a well-designed object-oriented API that provides improved support for modern advanced web-app testing problems.
Selenium Web Driver was developed in such a way that, it can support Multiple Browsers, the code can be written in Multiple Languages & can be executed in Multiple Platforms.
            Selenium Webdriver Architecture:
            Selenium web driver works on 3 components as mentioned below:
Figure 4: Selenium Webdriver Architecture

Friday, 10 March 2017

Running multiple test suites through testng.xml file

Till now we have implemented the SignIn & Registration work flow & able to run the test suites individually. But practically we need to run all the test suites from a single file. To run multiple test suites, we can add the testns.xml file & will pass all the test suites inside the testng.xml file.
  • Download the testng.xml file from here.
  • Copy the testng.xml file inside src/test/resources.
  • Right click on testng.xml file > Run As > TestNG Suite & verify the result. It should run the SignIn Test 1st after completion it will open another browser & will execute the RegistrationTest as well.

Tuesday, 7 March 2017

Implement Test Case for Registration Workflow.

Let’s focus what we covered till now?
  1. Automated the Sign in workflow.
  2. Generated the logs.
  3. Added screen shots in logs file.
  4. Implemented the failure/skip of test case/test data.

Thursday, 2 March 2017

Running all test scenarios in same browser & implement failure/skip in SignInTest

For running all test scenarios in same browser, we need to do the below steps:
  1. Open browser – 1time.
  2.  Do the operation(s) – multiple time.
  3.  After operation come to the initial state.
  4. After completion of all operation close the browser.

Wednesday, 1 March 2017

Parameterizing the test cases

Till now we have discussed about the doLogin() method where we are passing the default username & password. But in our SignInTest there are multiple test scenarios with different combinations. So, we should write the script in such a way that it will run as per the scenarios. To achieve this, we can use @DataProvider for @Test method.