Java, .NET, PHP, PYTHON, ANGULAR, ML, Data Science, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"

 Webdriver Script to work on CheckBox, ReadioButton, Dropdownlist, Listbox example :-


Now I am providing Live example to work on ListBox, DropDownList, CheckBox and RadioButton.




package scs;


import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.support.ui.Select;


public class SearchRoom {


public static void main(String[] args) {

System.setProperty("webdriver.chrome.driver", "c://chromedriver.exe");

WebDriver scs= new ChromeDriver();

scs.get("https://shivaconceptsolution.com/test.html");

Select cat = new Select(scs.findElement(By.name("c")));

cat.selectByIndex(1);

Select cat1 = new Select(scs.findElement(By.name("c[]")));

cat1.selectByIndex(1);

cat1.selectByIndex(2);

cat1.selectByIndex(3);

scs.findElement(By.name("chk2")).click();

scs.findElement(By.cssSelector("input[value='FeMale']")).click();;

//scs.findElement(By.className("btn-one w-100")).click();;


}


}



Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post