0% found this document useful (0 votes)
194 views3 pages

Selenium WebDriver Test Cases

This document contains the code for 4 test methods that perform various validation tests using Selenium WebDriver. The first test enters text into a form, clicks a button, and validates the result. The second test enters numbers, clicks to calculate a total, and validates the result. The third test selects options from a dropdown and validates the selection. The fourth test searches a site and validates the search results.

Uploaded by

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

Selenium WebDriver Test Cases

This document contains the code for 4 test methods that perform various validation tests using Selenium WebDriver. The first test enters text into a form, clicks a button, and validates the result. The second test enters numbers, clicks to calculate a total, and validates the result. The third test selects options from a dropdown and validates the selection. The fourth test searches a site and validates the search results.

Uploaded by

Andrei ShadowS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

@[Link].

Test

public void primulTest(){

[Link]("[Link]","D:\\kit\\[Link]");
WebDriver driver = new ChromeDriver();
[Link]().window().maximize();
String keyword = "primul test";
[Link]("[Link]

WebElement inputField = [Link]([Link]("user-message"));


[Link](keyword);
WebElement showMessage = [Link]([Link]("//*[@id=\"get-
input\"]/button"));
[Link]();
WebElement resultMessage = [Link]([Link]("display"));
[Link]([Link]() , keyword);
[Link]();
}
}

import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];

import [Link];
import [Link];
import [Link];

public class Test {


@[Link]

public void primulTest() {

[Link]("[Link]", "D:\\kit\\[Link]");
WebDriver driver = new ChromeDriver();
[Link]().window().maximize();
String keyword = "primul test";
[Link]("[Link]

WebElement inputField = [Link]([Link]("user-message"));


[Link](keyword);
WebElement showMessage = [Link]([Link]("//*[@id=\"get-
input\"]/button"));
[Link]();
WebElement resultMessage = [Link]([Link]("display"));
[Link]([Link](), keyword);
[Link]();
}
@[Link]

public void alDoileaTest() {

[Link]("[Link]", "D:\\kit\\[Link]");
WebDriver driver = new ChromeDriver();

int nr1 = 4;
int nr2 = 3;
int sum = nr1 + nr2;
[Link]("[Link]

WebElement firstField = [Link]([Link]("sum1"));


[Link]([Link](nr1));
WebElement secondField = [Link]([Link]("sum2"));
[Link]([Link](nr2));
WebElement getTotal =
[Link]([Link]("//*[@id=\"gettotal\"]/button"));
[Link]();
WebElement totalValue = [Link]([Link]("displayvalue"));
[Link]();

@[Link]
public void alTreileaTest() {

[Link]("[Link]",
"D:\\kit\\[Link]");
WebDriver driver = new ChromeDriver();
[Link]("[Link]
[Link]");
WebElement dropdownButton = [Link]([Link]("select-demo"));
Select selector = new Select(dropdownButton);
[Link]("Monday");
int index;
for(index=0; index <=7; index++);

[Link](index);
WebElement result =
[Link]([Link]("//*[@id=\"easycont\"]/div/div[2]/div[1]/div[2]/p[2]"))
;
switch(index){
case 1:
[Link]([Link](), "Day selected :- Sunday") ;
}

@[Link]

public void alPatruleaTest() {

[Link]("[Link]", "D:\\kit\\[Link]");
WebDriver driver = new ChromeDriver();

[Link]("[Link]
WebElement decathlonLogo = [Link]([Link]("dkt-logo"));
[Link]([Link]());

WebElement searchBar = [Link]([Link]("header-searchbar"));

List<String> listaCautari = new ArrayList<String>();


[Link]("placa de snowboard");
[Link]("gantere");
[Link]("racheta tenis");

Random random = new Random();

String keyword = [Link]([Link](2));

[Link]();
[Link](keyword);
[Link]([Link]);
WebElement searchResult =
[Link]([Link]("//*[@id=\"middle\"]/div[2]/div[1]/h1"));

[Link]([Link]().toLowerCase(),[Link]());

}
}

You might also like