3

Does java Webdriver mouseover work in headless silent mode (none GUI display)? I have this code that works when run in FF headless GUI mode BUT doesn't work when run in non-GUI mode (via Xvfb frame buffer).

FF 17.0.8 Selenium 2.33.0 Java Selenium WebDriver

I need to hover to a menu then click on an option from the submenu. Again, This works in headless GUI mode but does NOT work in headless silent (non-GUI) mode :(. How to debug in silent mode?

mainMenu = BaseWebDriver.driver.findElement(By.linkText("Copy"));
Actions builder = new Actions(BaseWebDriver.driver);
builder.moveToElement(mainMenu).build().perform();  //perform mouse hover
//click on the option on submenu
BaseWebDriver.driver.findElement(By.xpath("//*[@id='__content']/div/div/div[2]/div[2]/ul/li[6]/ul/li[2]/a")).click();

Any help is greatly appreciated!! -Terry

1 Answers1

-1

install xvfb using "sudo apt-get install xvfb"
Try running your script using "xvfb-run --auto-servernum"
Im using python with selenium and it worked for me, i ran the script like "xvfb-run --auto-servernum python test.py".

If the site you are testing is an public site means share the url, people will try on the same and give you solutions.

parthiban
  • 133
  • 1
  • 16