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.
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.