Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/305.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
Java 无法从选择标记中选择值。获取异常WebDriverException:未知错误:a.tagName.toUpperCase不是函数_Java_Selenium_Select_Selenium Webdriver_Tagname - Fatal编程技术网

Java 无法从选择标记中选择值。获取异常WebDriverException:未知错误:a.tagName.toUpperCase不是函数

Java 无法从选择标记中选择值。获取异常WebDriverException:未知错误:a.tagName.toUpperCase不是函数,java,selenium,select,selenium-webdriver,tagname,Java,Selenium,Select,Selenium Webdriver,Tagname,我正在使用chrome驱动程序和Windows10操作系统。通过使用select类,我可以从select标记中找到选项。但无法按索引或visibleText或任何其他方式选择选项 <select class="pull-left" name="status"> <option value="">Status</option> <option class="select-value" value="Valid" >Va

我正在使用chrome驱动程序和Windows10操作系统。通过使用select类,我可以从select标记中找到选项。但无法按索引或visibleText或任何其他方式选择选项

<select class="pull-left" name="status">
        <option value="">Status</option>
        <option class="select-value" value="Valid" >Valid</option>
        <option class="select-value" value="Ivalid">Invali</option>
</select>

org.openqa.selenium.WebDriverException:f.QueryInterface不是函数
由于缺少协议而发生异常。检查这个,哪一行抛出了那个错误?考虑到这一版本有多奇怪,我可能会先检查我的
浏览器
chromedriver
,可能还有
网络驱动程序
版本。您在其他浏览器中尝试过吗?
select.selectByVisibleText(“状态”)在选择值时,我遇到了上述错误,我尝试了所有可能的方法,如selectByValue()、SelectByIndex()和selectByVisibleText();。我试过FirefoxDriver,代码运行良好。仅针对ChromeDriver,我收到此
org.openqa.selenium.WebDriverException:未知错误:a.tagName.toUpperCase不是函数。
因此,请有人向我建议解决此问题的方法。
org.openqa.selenium.WebDriverException:f.QueryInterface不是函数
由于缺少协议检查这个,哪一行抛出了那个错误?考虑到这一版本有多奇怪,我可能会先检查我的
浏览器
chromedriver
,可能还有
网络驱动程序
版本。您在其他浏览器中尝试过吗?
select.selectByVisibleText(“状态”)在选择值时,我遇到了上述错误,我尝试了所有可能的方法,如selectByValue()、SelectByIndex()和selectByVisibleText();。我试过FirefoxDriver,代码运行良好。仅针对ChromeDriver,我收到此
org.openqa.selenium.WebDriverException:未知错误:a.tagName.toUpperCase不是函数。
因此,请有人向我建议解决此问题的方法。
    @FindBy(xpath="//select[@name='status']")
    WebElement drop;


    Select sel=new Select(drop);
    List<WebElement> ls=sel.getOptions();
    for (WebElement webElement : ls) {
        System.out.println(webElement.getText());
    }
    sel.selectByVisibleText("Status");
 org.openqa.selenium.WebDriverException: unknown error: a.tagName.toUpperCase is not a function 
    (Session info: chrome=56.0.2924.87) 
    (Driver info: chromedriver=2.25.426923 (0390b88869384d6eb0d5d09729679f934aab9eed),platform=Windows NT 10.0.14393 x86_64) (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 55 milliseconds
    Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700'