Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
seleniumElement.click()在vb.net中不起作用_Vb.net_Selenium - Fatal编程技术网

seleniumElement.click()在vb.net中不起作用

seleniumElement.click()在vb.net中不起作用,vb.net,selenium,Vb.net,Selenium,导致此错误的代码有什么错误 错误;click不是openqa.selenium的成员 Imports System.Text Imports OpenQA.Selenium Imports OpenQA.Selenium.Chrome Module Module1 Sub Main() Dim driver As IWebDriver driver = New ChromeDriver driver.Navigate().GoToUr

导致此错误的代码有什么错误 错误;click不是openqa.selenium的成员

Imports System.Text
Imports OpenQA.Selenium
Imports OpenQA.Selenium.Chrome


Module Module1

    Sub Main()
        Dim driver As IWebDriver
        driver = New ChromeDriver
        driver.Navigate().GoToUrl("https://m.facebook.com/")
        Dim element As IWebDriver = driver.FindElement(By.Id("u_0_b"))
        System.Threading.Thread.Sleep(10000)
        element.Click()
    End Sub

End Module

IWebDriver类型没有单击方法。将声明中
元素
变量的类型更改为IWebElement:

Dim element As IWebElement = driver.FindElement(By.Id("u_0_b"))