Skip to content

Instantly share code, notes, and snippets.

@harsha509
Created November 20, 2023 19:49
Show Gist options
  • Save harsha509/bedccc97c37992c38bc280479afc5baf to your computer and use it in GitHub Desktop.
Save harsha509/bedccc97c37992c38bc280479afc5baf to your computer and use it in GitHub Desktop.
import org.openqa.selenium.*;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class TestSelenium {
public static void main(String[] args) throws InterruptedException {
WebDriver driver = new ChromeDriver();
driver.get("https://www.surveymonkey.com/r/CHP86NN");
Thread.sleep(2000);
WebElement option= driver.findElement(By.xpath("//*[@id='153853250_1164002632_label']/span[1]"));
option.click();
Thread.sleep(1000);
WebElement submit= driver.findElement(By.xpath("(//button[@type='submit'])[3]"));
submit.click();
Thread.sleep(1000);
driver.quit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment