Sanjoy
Sanjoy

Reputation: 336

Move to Element Syntax in Seleniumbasic - Excel VBA

I have looked across everywhere to find answers but could not get it, so would like your help in guiding me. Selenium Basic (Excel VBA ) is giving me syntax error at the time of compilation. My Objective is to move the mouse to a known element.

Here are the codes

 Dim driver As New WebDriver
 Dim actions As Selenium.actions
 driver.Start "chrome", "http://anywebsite.com"
 driver.get "/"

 WebElement we = driver.FindElementByClass("MyClassName")
 actions.MoveToElement (we)

It gives me an error at the compilation level as and FindElementByClass is highlighted. However in the watch window I can see values against it.

Compile Error: Sub or Function Not Defined

Would request if you can guide me since in the watch

Upvotes: 1

Views: 3877

Answers (1)

user14381056
user14381056

Reputation: 26

Change

driver.actions.MoveToElement(we)

to

driver.actions.MoveToElement(we).perform

Upvotes: 1

Related Questions