



















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Demo Demo Demo Demo Demo Demo Demo
Typology: Essays (high school)
1 / 27
This page cannot be seen from the preview
Don't miss anything!




















import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class pro1 { public static void main(String[] args)throws InterruptedException { System.setProperty("webdriver.chrome.driver","C:\Users\gokul\Downloads\c hromedriver-win64\chromedriver-win64\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("https:/www.google.com"); } }
import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class selenium3 { public static void main(String[] args) throws InterruptedException { // Set the path to the ChromeDriver executable System.setProperty("webdriver.chrome.driver", "/home/skasc/Downloads/chromedriver"); WebDriver driver = new ChromeDriver(); driver.get("http://www.google.com"); driver.findElement(By.name("q")).sendKeys("selenium"); driver.findElement(By.name("q")).sendKeys(Keys.ENTER); driver.findElement(By.className("Tg7LZd")).click(); driver.quit(); } }
import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class pro1 { public static void main(String[] args) throws InterruptedException { // TODO Auto-generated method stub System.setProperty("webdriver.chrome.driver","C:\Users\gokul\Downloads\c hromedriver-win64\chromedriver-win64\chromedriver.exe"); WebDriver driver=new ChromeDriver(); driver.get("https://www.google.com"); driver.findElement(By.linkText("Sign in")).click(); driver.findElement(By.partialLinkText("Sign")).click(); driver.findElement(By.id("identifierID")).sendKeys("[email protected]"); } }
import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class pro1 { public static void main(String[] args) throws InterruptedException { // TODO Auto-generated method stub System.setProperty("webdriver.chrome.driver","C:\Users\gokul\Downloads\c hromedriver-win64\chromedriver-win64\chromedriver.exe"); WebDriver driver=new ChromeDriver(); driver.get("https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_button_ test"); driver.manage().window().maximize(); driver.switchTo().frame("iframeResult"); driver.findElement(By.xpath("/html/body/button")).click(); driver.switchTo().defaultContent(); } }
import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import java.util.concurrent.TimeUnit; public class pro7a { public static void main(String[] args)throws InterruptedException { System.setProperty("webdriver.chrome.driver", "C:\Users\gokul\Downloads\chromedriver-win64\chromedriver- win64\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("https://phptravels.com/demo/"); driver.manage().window().maximize(); driver.manage().timeouts().implicitlyWait(300,TimeUnit.SECONDS); driver.close(); } }
import org.openqa.selenium.By; import org.openqa.selenium.Alert; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class pro { public static void main(String[] args) throws InterruptedException { System.setProperty("webdriver.chrome.driver","C:\Users\gokul\Downloads\c hromedriver-win64\chromedriver-win64\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("https://demo.guru99.com/test/delete_customer.php"); driver.findElement(By.name("cusid")).sendKeys("53920"); driver.findElement(By.name("submit")).submit(); Alert alert = driver.switchTo().alert(); String alertMessage= driver.switchTo().alert().getText(); System.out.println(alertMessage); Thread.sleep(5000); alert.accept(); }}