Selenium Training E-learning Project Tutorial – Part 2

Last week, We added another item to our training portal last week, for the E-learning project for testing.  In the last tutorial for this project, we discussed the following things:

  1. Project Overview
  2. The functionality flows for ITlearn360
  3. The Selenium code for testing the ITlearn360 login process.
  4. Additionally, we explored how to search the course (Note: You can add the code to search the course in the second module).

In this tutorial, we are going to test the Registration process of ITlearn360. Please check the functionality flow:

Note: You can change the order of testing, like First registration then log in, or vice versa.

To get more info, please click on the following link:

Selenium Training E-learning Project Tutorial – Part 1

If you are a beginner in Automation Selenium Testing, then you can start with easy-to-understand projects:

  1. E-learning
  2. User management
  3. CRM
  4. Travel Booking
  5. E-commerce
  6. Hotel Management
  7. Library Management and so on.

The above projects are easy to understand because the functionalities of these projects are ones that we perform in day-to-day life

E-learning Project – Registration Process – ITlearn360

Let us assume that your Team lead has asked you to test the registration process.  Before moving further, you have to create steps. So under Actions Tasks, you can find the problem statement and the steps.

Actions Tasks

Problem Statement

Imagine a scenario where a candidate has to register for a course on the itlearn360 portal.

Now we need to write a test script to test this scenario. We need to perform the following tasks in the following order:

  1. Open http://demo.itlearn360.com
  2. Click on the Get Started button.
  3. Provide a Username.
  4. Provide an Email ID.
  5. Provide the First name.
  6. Provide the Last name.
  7. Provide Country.
  8. Enter Contact number
  9. Click on the Register button.
  10. Verify registration process by matching registration message.
  11. Close the browser.

Test Script

package testing.org;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;

public class RegistrationProcess {

    public static void main(String[] args) throws InterruptedException {
        // TODO Auto-generated method stub
        System.setProperty("webdriver.chrome.driver", "C:\\Users\\Jayant\\Pictures\\qatraininimages\\chromedriver_win32\\chromedriver.exe");
        ChromeDriver browserObject = new ChromeDriver();
        browserObject.get("http://demo.itlearn360.com/");
        browserObject.manage().window().maximize();
        browserObject.manage().timeouts().implicitlyWait(20,TimeUnit.SECONDS) ;
        JavascriptExecutor js = (JavascriptExecutor) browserObject;
    	js.executeScript("window.scrollBy(0,350)", "");
    	browserObject.findElement(By.xpath("//*[@id=\"training_process\"]/div[1]/p/a")).click();
    	
    	browserObject.findElement(By.name("user_login")).sendKeys("yourusername");
    	browserObject.findElement(By.name("user_email")).sendKeys("youremailid");
    	
    	browserObject.findElement(By.name("user_fname")).sendKeys("Traineer");
    	browserObject.findElement(By.name("user_lname")).sendKeys("Demmo");
    	browserObject.findElement(By.name("country")).sendKeys("USA");
    	browserObject.findElement(By.name("contactno")).sendKeys("8888888888");
    	browserObject.findElement(By.name("wp-submit")).click();
    	Thread.sleep(2000);
    	//Verify messages which show after complete successful registration
    	WebElement message = browserObject.findElement(By.xpath("//*[@id=\"login\"]/p[1]"));
    	String message_string = message.getText();
    	if(message_string.contains("Registration complete. Please check your email")) {
    		System.out.println("Testing of registration process is verified");
    	}else {
    		System.out.println("Testing of registration process is not verified");
    	}
    	browserObject.quit();
    }

}

 

Instructor-led Training

Important note: we like to tell you that free tutorials are useful to get started but if you are interested in the best online LIVE Master of Automation Testing training program from the experts, please refer to the following link:

For Instructor-led training

Master of Functional Automation Testing

For Self-Driven training

Automation with Selenium WebDriver (Java)

Selenium Training E-learning Project Tutorial – Part 1