java - Not able to do mouse over operation using selenium webdriver -
below code
webdriver dr= new chromedriver(); dr.get("http://obsessory.com/"); dr.findelement(by.xpath("html/body/header/div[2]/div[1]/ul/li[1]/a")).click(); dr.findelement(by.id("email")).sendkeys("username@gmail.com"); dr.findelement(by.name("loginform[password]")).sendkeys("password"); dr.findelement(by.xpath(".//[@id='signin']/div[2]/div[3]/div[3]/input")).click(); actions action = new actions(dr); webelement = dr.findelement(by.xpath("html/body/header/div[2]/div[1]/ul/li[4]/a/span")); action.movetoelement(we).movetoelement(dr.findelement(by.xpath("html/body/header/div[2]/div[1]/ul/li[4]/ul/li[1]/a"))).click().build().perform();
i wanted click on 'my accounts' or of other links. kindle tell me how
@kavya
please try code. think not able type password in password textbox.
for password:
dr.findelement(by.xpath("(//input[@id='email'])[2]")).sendkeys("obsessory");
for menu:
webelement = dr.findelement(by.xpath("html/body/header/div[2]/div[1]/ul/li[4]/a")); webelement ve = dr.findelement(by.xpath("html/body/header/div[2]/div[1]/ul/li[4]/ul/li[1]/a")); actions act = new actions(dr); act.movetoelement(we).click(ve).perform();
hope work
Comments
Post a Comment