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

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -