Amol Naik
Amol Naik

Reputation: 453

Press Enter and Down arrow key in VBA-Selenium

I want to write a code in vba-selenium to press Enter and Down arrow key so can u please help me.

I have tried below code but it's not working

 selenium.keyDownNative ("40") //For Down Arrow key
 selenium.keyPressNative("10") //For Enter

Upvotes: 0

Views: 15063

Answers (2)

Amol Naik
Amol Naik

Reputation: 453

I have used below code and got success.

Dim keys As New SeleniumWrapper.keys
selenium.SendKeys keys.ArrowDown
selenium.SendKeys keys.Enter

In order to make the above code work, I also had to install the SeleniumWrapper.exe in addition to the core SeleniumBasic package.

I also had to go into the Visual Basic Editor in Excel and select

Tools > References > SeleniumWrapper Type Library

and check that box to make the above code compile.

I found a good download here: https://seleniumwrapper.software.informer.com/download/

Upvotes: 5

Shubham Jain
Shubham Jain

Reputation: 17553

Try below :-

try {
     Thread.sleep(700);
    } catch (InterruptedException e) {}
    selenium.keyPressNative("40"); //For Down Arrow key
    selenium.keyPressNative("10"); // Enter 

Upvotes: 0

Related Questions