How to get a tooltip text on mouseover using Selenium WebDriver -


i not able tooltip text after mouseover on icon tooltip. need tooltip text,this html code.

    <a class="tooltip" onclick="socialauth.showopenidloginwindow('google');_gaq.push(['_trackevent','loginform','google-login','google login clicked']);" href="javascript:void(0);"><span>we dont store password or access contacts on google account.</span><img class="social" height="39" width="40" src="/images/login/google.png"/> 

you have use actions this. in printing mouse hover message in google

    actions tooltip1 = new actions(driver);     webelement googlelogo = driver.findelement(by.xpath("//div[@id='hplogo']"));      thread.sleep(2000);      tooltip1.clickandhold(googlelogo).perform(); 

perform mouse hover action using 'clickandhold' method.

get value of tool tip using 'getattribute' command

    string tooltiptext = googlelogo.getattribute("title");      assert.assertequals(tooltiptext, "google");      thread.sleep(2000);     system.out.println("tooltip value is: " + tooltiptext); 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -