Note that there are some explanatory texts on larger screens.

plurals
  1. POSelenium WebDriver mouse actions moveToElement on Firefoxe
    primarykey
    data
    text
    <p>I wrote a simple code in java that moves the mouse pointer to a menu bar of a website. when mouse moves on "Demo page 1", its sub-menu opens and then I can clicked on "Demo page 4". The code works perfectly on my laptop.</p> <p>since my laptop is a bit slow I moved the code to my Lenovo Pc. Now when I run the code, the opened menu is not shown. Surprisingly,the mouse is moving to "Demo page 1" in background because its address is shown in the status bar, however since the opened menu is not shown, I cant use click() method to open the "Demo page 4" because it is invisible. The code is here:</p> <pre><code> // DemoPage11 is the xpath of "Demo Page 1" which is an item in the main menu String DemoPage11 = "//*[@id='access']//div[3]//ul//li[2]//a"; // DemoPage114 is the xpath of "Demo Page 4" which is a sub-menu of "Demo Page 1" String DemoPage114 = "//*[@id='access']//div[3]//ul//li[2]//ul//li//a"; ProfilesIni allProf = new ProfilesIni(); FirefoxProfile p = allProf.getProfile("default"); p.setEnableNativeEvents(true); WebDriver wd1 = new FirefoxDriver(p); // I use driver for scrolling the page and it works perfectly EventFiringWebDriver driver = new EventFiringWebDriver(wd1); wd1.get("http://benchmarkazure.cloudapp.net/wordpress/"); wd1.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); Actions builder = new Actions(wd1); builder.moveToElement(wd1.findElement(By.xpath(DemoPage11))).build().perform(); WebElement weDemoPage114 = (new WebDriverWait(wd1, 30)).until(ExpectedConditions.presenceOfElementLocated(By.xpath(DemoPage114))); wd1.findElement(By.xpath(DemoPage114)).click(); wd1.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); </code></pre> <p>Unfortunatly, I'm not allowed to upload an image to clarify. If you can help me and need to see the screen-shots of the results in my laptop v.s. the Lenovo PC, please give me your email address, then I will send it for you.</p> <p>I really appreciate your soon replies because I have to finish it sooner. Thanks Amir</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload