Mousehoover not working in Chrome browser | Selenium Forum
M
Posted on 13/12/2015
** My below code is working fine with Firefox but it's not working in Chrome, it's giving 'Element not visible error'. Please some one give me suggestion.

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.Select;

public class Yahoo_Registration {

public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub

//WebDriver driver = new FirefoxDriver();
System.setProperty("webdriver.chrome.driver","C:\\Users\\mem pc\\eclipse\\chromedriver.exe");
WebDriver driver = new ChromeDriver();


Thread.sleep(3000);
driver.get("https://www.yahoo.com/");
driver.manage().window().maximize();
//driver.manage().timeouts().pageLoadTimeout(240,TimeUnit.SECONDS);
Actions dd = new Actions(driver);
Thread.sleep(1000);
dd.moveToElement(driver.findElement(By.xpath(".//*[@title='Sign In']"))).build().perform();
Thread.sleep(20000);


driver.findElement(By.xpath(".//*[@class='y-hdr-link sign-up']")).click();
driver.findElement(By.xpath(".//*[@name='firstname']")).sendKeys("Saadat");
driver.findElement(By.xpath(".//*[@name='secondname']")).sendKeys("Chowdhury");

Select objSelect1 = new Select(driver.findElement(By.id("month")));
objSelect1.selectByVisibleText("February");

Select objSelect2 = new Select(driver.findElement(By.id("day")));
objSelect2.selectByVisibleText("15");

Select objSelect3 = new Select(driver.findElement(By.id("year")));
objSelect3.selectByVisibleText("2012");










}

}

M
Replied on 13/12/2015

[quote:24oy2gjr]@class='y-hdr-link sign-up'][/quote:24oy2gjr]

the xpath is not stable please find the more stable xpath.


M
Replied on 14/12/2015

[quote="qtpselenium.supp0rt@gmail.com":d7kmcenu][quote:d7kmcenu]@class='y-hdr-link sign-up'][/quote:d7kmcenu]

the xpath is not stable please find the more stable xpath.[/quote:d7kmcenu].

Its the same class in Chrome also and it's stable not changing and it always working in Firefox .
I tried with this one also driver.findElement(By.xpath(".//*[@class='y-hdr-ln sign-up-btn']")).click();
but still not working.


M
Replied on 14/12/2015

i tried your code in firefox it didn't run.

Responsive image