9

Hope someone can help/point me to a answer....

I am using Codeception for testing our website. All is well, except that I can not find a way to hover over a menu element to reveal the rest of the menu.

With watir & webdriver I was able to use

browser.div(:class->"menu-item-1").hover

I did find moveMouseOver, but it does not seem to work. I've tried

moveMouseOver('//div/div/div/div/ul/li[2]/a')

and

moveMouseOver('.menu-item-1')

user2906554
  • 91
  • 1
  • 4

1 Answers1

8

This is working for me with Codeception version 2.0.9 (to test for the appearance of Pin It buttons on image hover on a WordPress blog post):

$I->amOnPage( '/blog/post-1/' );
$I->moveMouseOver( '.entry-content img' );
$I->seeElement( 'a[title="Pin it!"]' );
  • Correct me if I am wrong but wouldn't `$I->seeElement( 'a[title="Pin it!"]' );` be true regardless of the mouse over? – Chris May 25 '15 at 00:12
  • 1
    No, because `seeElement` checks that the element is present and visible while `seeElementInDOM` checks that it exists whether it's visible or not. http://codeception.com/docs/modules/WebDriver#seeElement – Mill Hill Automation May 26 '15 at 10:13
  • Fails with latest version of Selenium and Firefox, but works fine with Firefox 47.0.1 and Selenium 2.53.1. – Guillaume Renoult Feb 07 '17 at 05:59