java - How to logout gmail using selenium script? -



java - How to logout gmail using selenium script? -

i writing selenium script gmail login , logout functionality. able login using below code.

//open gmail driver.get("http://www.gmail.com"); // come in userd id webelement element = driver.findelement(by.id("email")); element.sendkeys("xyz@gmail.com"); //wait 5 secs userid 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 not write script logout. yu please provide me script logout?

thanks!

try below code.

driver.findelement(by.classname("gb_ta")).click(); // click flyout menu driver.findelement(by.classname("gb_71")).click(); // click sign out button

java selenium automation

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -