Automation Using Selenium Webdriver

Tuesday, 18 October 2016

Yahoo mail sign out Code Selenium WebDriver

Code for yahoo mail sign out

FirefoxDriver driver = new FirefoxDriver();
driver.get("https://login.yahoo.com/config/login_verify2?.intl=ca&.src=ym");
driver.manage().window().maximize();

WebElement element = driver.findElement(By.id("username"));
element.sendKeys("myid@yahoo.com");

driver.findElement(By.id("passwd")).sendKeys("mypassword");
element.submit();
Thread.sleep(40000);

driver.findElement(By.linkText("Sign Out")).click();  
Thread.sleep(40);

No comments:

Post a Comment