Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
104 views

Software Manual Selenium

The document provides a manual for testing software using Selenium. It outlines 5 steps: 1) understanding automation testing approaches, 2) using Selenium IDE to write 4 test cases, 3) demonstrating a Java script using Selenium server to test a login form, 4) demonstrating another Java script to test an HTML login form, and 5) demonstrating a Java script using element IDs to test a login form. The manual includes example programming steps and code for setting up tests in Selenium.

Uploaded by

Arpita Bhamre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views

Software Manual Selenium

The document provides a manual for testing software using Selenium. It outlines 5 steps: 1) understanding automation testing approaches, 2) using Selenium IDE to write 4 test cases, 3) demonstrating a Java script using Selenium server to test a login form, 4) demonstrating another Java script to test an HTML login form, and 5) demonstrating a Java script using element IDs to test a login form. The manual includes example programming steps and code for setting up tests in Selenium.

Uploaded by

Arpita Bhamre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Software Testing Manual: Using Selenium

Lab Manual for Software Testing using Selenium

1)Understand the Automation Testing Approach(Theory concept)

2)Using Selenium IDE , write a test suite containing minimum 4 test


cases

Programming steps

I) Download the selenium IDE


Link :-https://www.selenium.dev/selenium-ide/

Click on CHROME DOWNLOAD

Click on Add to Chrome

Click on Add Extension


click on Record a new test in a new project
Write a PROJECT NAME

For example we test Rohit Sharma Wikipedia


hence we give the test name is Rohit Sharma

BASE URL (copy paste from google)


https://en.wikipedia.org/wiki/Rohit_Sharma

click on at right top cornerStart Recording

Visit website

Click on Stop Recording

Test Name

Run All Test


1
Software Testing Manual: Using Selenium

Base URL :-https://en.wikipedia.org/wiki/Rohit_Sharma


Test Run Successfully

3)Demonstrate it using a script in Java using name in Selenium server

Programming Steps:

packagerupa;

importjava.util.concurrent.TimeUnit;

importorg.openqa.selenium.By;
importorg.openqa.selenium.WebDriver;
importorg.openqa.selenium.WebElement;
importorg.openqa.selenium.chrome.ChromeDriver;

public class second {

@SuppressWarnings("deprecation")
public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub

System.setProperty("webdriver.chrome.driver","C:\\seleniumDriver\\
chromedriver.exe");

WebDriver driver=new ChromeDriver();

driver.get("https://demo.guru99.com/test/login.html");
Thread.sleep(5000);
driver.manage().window().maximize();

WebElement email = driver.findElement(By.name("email"));


Thread.sleep(5000);

WebElement passwords =
driver.findElement(By.name("passwd"));
Thread.sleep(5000);

2
Software Testing Manual: Using Selenium

email.sendKeys("aishwarya");
Thread.sleep(5000);

passwords.sendKeys("xyz123");
Thread.sleep(5000);

WebElementsubmitButton =
driver.findElement(By.name("SubmitLogin"));
submitButton.click();
Thread.sleep(5000);

}
4)Demonstrate it using a script in Java using HTML Login from in
Selenium server

Programming Steps:

packagerupa;

importjava.util.concurrent.TimeUnit;

importorg.openqa.selenium.By;
importorg.openqa.selenium.WebDriver;
importorg.openqa.selenium.WebElement;
importorg.openqa.selenium.chrome.ChromeDriver;

public class second {

@SuppressWarnings("deprecation")
public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub

System.setProperty("webdriver.chrome.driver","C:\\seleniumDriver\\
chromedriver.exe");

3
Software Testing Manual: Using Selenium

WebDriver driver=new ChromeDriver();

driver.get("file:///C:/Users/Admin1/Desktop/page.html");
Thread.sleep(5000);
driver.manage().window().maximize();

WebElement email = driver.findElement(By.name("uname"));


Thread.sleep(5000);

WebElement passwords =
driver.findElement(By.name("password"));
Thread.sleep(5000);

email.sendKeys("aishwarya");
Thread.sleep(5000);

passwords.sendKeys("xyz123");
Thread.sleep(5000);

WebElementsubmitButton =
driver.findElement(By.name("login"));
submitButton.click();
Thread.sleep(5000);

}
HTML From
<html>
<body>

<input type="text" placeholder="Enter Username" name="uname">

<input type="password" placeholder="Enter Password" name="password">


<div class="container">
<a href="https://www.google.com/">
<button class="btnbtn-primary btn-lg" name="login">login</button>

4
Software Testing Manual: Using Selenium

</a>
</div>
</body>
</html>

5)Demonstrate it using a script in Java using ID in Selenium server

Programming Steps:

packagerupa;

importjava.util.concurrent.TimeUnit;

importorg.openqa.selenium.By;
importorg.openqa.selenium.WebDriver;
importorg.openqa.selenium.WebElement;
importorg.openqa.selenium.chrome.ChromeDriver;

public class second {

@SuppressWarnings("deprecation")
public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub

System.setProperty("webdriver.chrome.driver","C:\\seleniumDriver\\
chromedriver.exe");

WebDriver driver=new ChromeDriver();

driver.get("https://demo.guru99.com/test/login.html");
Thread.sleep(5000);
driver.manage().window().maximize();

WebElement email = driver.findElement(By.id("email"));


Thread.sleep(5000);

WebElement passwords = driver.findElement(By.id("passwd"));

5
Software Testing Manual: Using Selenium

Thread.sleep(5000);

email.sendKeys("aishwarya");
Thread.sleep(5000);

passwords.sendKeys("xyz123");
Thread.sleep(5000);

WebElementsubmitButton =
driver.findElement(By.id("SubmitLogin"));
submitButton.click();
Thread.sleep(5000);

You might also like