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.


Implement Logging in Page Classes

In the previous post, we have created the extent reports & used in sign in test. Now, suppose we want to implement the logging in our page classes. For logging in page classes, we need to pass the ExtentReports & ExtentTest object into our page classes. We can follow the same steps as we did while passing the WebDriver object in page classes.