Support > Forums > OpenBots Studio > Selenium Execute Script

Selenium Execute Script

Karthik Kasaraneni

  • Reporter
  • Calender Icon December 09,2021 at 5:03 PM

Hi,

Can you help, how this selenium execute script works?

I'm not able to Get output to the Output variable I have defined,

Is there any example I can refer?

This forum has 172 topics, 459 replies, and was last updated an hour ago by Poornima Malv

Lakshmi Sukumar

  • Participant
  • Calender Icon December 20,2021 at 8:01 PM

You could be missing a dependency. Could you try installing the Server commands from Package Manager and looking for the OpenQA.Selenium library again?

Also, note that you can use the OBAppInstance variable declared in the Selenium Create Browser command to call selenium driver scripts. You'd need to use the Set Variable command to set the OBAppInstance variable to a driver variable, like ChromeDriver.

For example: vDriver = vAppInstance.Value

Karthik Kasaraneni

  • Participant
  • Calender Icon December 19,2021 at 1:08 AM

I have installed the OpenQA.selenium.Winium and OpenQA.selenium.Chrome.ChromeDriver, When I'm trying to setup the 'Selenium Get Element(s)', In the Output variable, Default Type "OpenQA.Selenium.IWebElement" not found in Moreoptions?

Lakshmi Sukumar

  • Participant
  • Calender Icon December 15,2021 at 6:39 AM

The issue could be related with the script itself, since DOM may not be returning a value.

To get an element by Tag Name, you could use the Selenium Get Element(s) command. For the Search Parameter value only select the Tag Name field and indicate "LI" as the value. In Element Search Option field set the value to "Find Elements" if you want to retrieve a list of IWebElements. Else, the "Find Element" option will only return the top most element.

Note: In order to be able to create the IWebElement variable to hold the output, you'll need to import the OpenQA.Selenium library.

Karthik Kasaraneni

  • Participant
  • Calender Icon December 13,2021 at 1:27 AM

I'm trying to execute this DOM, document.getElementsByTagName("LI")

Lakshmi Sukumar

  • Participant
  • Calender Icon December 13,2021 at 12:09 AM

Hello!

what selenium script are you trying to call?

You are not authorized to reply, please click here to login and add your reply to this topic.