|
-
Jan 16th, 2021, 12:45 AM
#1
Thread Starter
New Member
How to use “action” in vb.net using selenium webdriver?
I am using selenium webdriver to automate chrome in VB.net (2019 version). I want to send some keystrokes to chrome using action. I have tried the following code
Dim driver As IWebDriver
driver = New ChromeDriver
driver.Navigate().GoToUrl("https://example.com/")
Dim action1 As Action = New Action(driver)
and it is showing me following error at "New action(driver)" location "Delegate "action: requires as "address of" expression or Lambda expression..."
I have imported the following references
Imports SileniumTest
Imports OpenQA.Selenium
Imports OpenQA.Selenium.Firefox
Imports OpenQA.Selenium.Chrome
Imports OpenQA.Selenium.Support.UI
Imports OpenQA.Selenium.Keys
Imports OpenQA.Selenium.Interactions.Actions
Imports OpenQA.Selenium.Interactions
Please let me know what is causing this error?
PS: I have tried using this
Dim element As IWebElement = driver.FindElement(By.Id("userid"))
element2.SendKeys("xyz" & Keys.Enter)
This thing works.
But, I want to use actions because I do not have ID of one text box and I want to mimic keyboard.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|