Re: cannot convert from 'openqa.selenium.by' to 'openqa.selenium.iwebelement'

691 views
Skip to first unread message
Message has been deleted

nasir mohd

unread,
May 7, 2017, 3:28:50 PM5/7/17
to Selenium Users

This line is incorrect Rmouseover.MoveToElement(RMenu).Perform();
instead it should be:
Rmouseover.MoveToElement(driver.findElement(RMenu)).Perform();
On Sunday, 7 May 2017 02:44:59 UTC+5:30, Geezus wrote:

I am trying to perform a mouseover and then click on a submenu that wasn't present..

This is my code:


private By RMenu = By.LinkText("Reports");

    public HomePage SetMenu(string menu)
    {
        Actions Rmouseover = new Actions(_driver);
        Rmouseover.MoveToElement(RMenu).Perform();
        return this;
    }


And I am getting this error at (RMenu) `Rmouseover.MoveToElement(RMenu).Perform()`:

cannot convert from 'openqa.selenium.by' to 'openqa.selenium.iwebelement'

I have tried `Rmouseover.MoveToElement(RMenu).Build().Perform()` and I still get the same error. What am I doing wrong or what am I not doing?


Dinesh Kumar R

unread,
May 8, 2017, 3:23:08 AM5/8/17
to Selenium Users
Hi Geezus-

The Argument to MoveToElement  method should be of webdriver's type. Seems like you have passed the object type of By class.

Regards,
Dinesh Kumar R.
Developer in Test.
 
Reply all
Reply to author
Forward
0 new messages