LambdaTest Community

Find answers, support, and inspiration from other users

Questions
LambdaTest Community
Unanswered

How to logout gmail using selenium script?

I am writing selenium script for Gmail login and logout functionality. I am able to successfully login using below code.

//Open gmail
         driver.get("http://www.gmail.com");

         // Enter userd id
         WebElement element = driver.findElement(By.id("Email"));
         element.sendKeys("xyz@gmail.com");

         //wait 5 secs for  userid to be entered
         driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);

         //Enter Password
         WebElement element1 = driver.findElement(By.id("Passwd"));
         element1.sendKeys("Password");

         //Submit button
         element.submit();

But i could not write a script to logout. Could yu please provide me script for logout?

Thanks!

Up Vote Down Vote 0 Votes
Posted 29 days ago

Answers

131 Views
0 Answers
29 days ago