Support > Forums > OpenBots Studio > Create Variable of type "OpenQA.Selenium.IWebElement"

Create Variable of type "OpenQA.Selenium.IWebElement"

Manfred Noner

  • Reporter
  • Calender Icon April 17,2022 at 11:10 AM

Hi Guys, I am new to Openbots and currently try out some stuff. Therefore I have a couple of questions: e.g. how can I create a variable of type "OpenQA.Selenium.IWebElement" or "System.Collections.Generic.List<OpenQA.Selenium.IWebElement>"?

Thx a lot Manfred

This forum has 313 topics, 680 replies, and was last updated 16 days ago by Faheem Syed

Manfred Noner

  • Participant
  • Calender Icon April 19,2022 at 8:54 PM

Hi, thx a lot, it worked. In another forum topic, I already learned to install "OpenQA.Selenium.Winium" package but to add "OpenQA.Selenium" to the imports seems to be the solution! Now I can create both variable types. As mentioned - thx a lot. :-) br Manfred

Poornima Malviya

  • Participant
  • Calender Icon April 19,2022 at 6:02 PM

Hi,

As per the root cause analysis. Inorder to use that variable OpenQA.Selenium.IWebElement or �System.Collections.Generic.List<OpenQA.Selenium.IWebElement>� Please follow below steps

  1. Go to package manager - Under all packages ->Select Nuget -> Search for OpenQA.Selenium.Winium and install it
  2. Once the installation is completed. Go to imports tab in the studio and in the dropdown select ->OpenQA.Selenium and add it in the imports.
  3. Once added -> Create variable using Ctrl+K ->Under define variable type dropdown select ->More options ->Types window ->Search for OpenQA.Selenium.IWebElement and variable will be added.
  4. In case you want to create System.Collections.Generic.List then Create variable using Ctrl+K ->Under define variable type dropdown select ->More options ->Types window ->Search for System.Collections.Generic.List and to choose type of list -> in the dropdown select more options ->Types window ->Search for OpenQA.Selenium.IWebElement and variable will be added.

Please let me know if it helped.

Poornima Malviya

  • Participant
  • Calender Icon April 19,2022 at 1:53 PM

Hi,

Thankyou for sharing your query. Can you please let me know which selenium command or nuget package you are using to assign this variable and also the version of OpenBots.

If you need to create any new variable of a specific type -> Ctrl+k -> Under define variable type dropdown select -> More options Types window -> Type this in search bar -> System.Collections.Generic.List and select that and to select list of type -> more options and select that type you want to choose.

Thanks. Please let me know if it helped.

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