1

Am using chrome driver and windows 10 OS. By using select class am able to find options from the select tag. but unable to chose the options by index or visibleText or any.

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

Selenium Code-

    @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");

Console Output:-

 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'
Farmer
  • 4,093
  • 3
  • 23
  • 47
z_1_p
  • 409
  • 1
  • 3
  • 16
  • `org.openqa.selenium.WebDriverException: f.QueryInterface is not a function` exception happens because of the missing protocol. Check this http://stackoverflow.com/questions/22145776/selenium-org-openqa-selenium-webdriverexception-f-queryinterface-is-not-a-fun – Farmer Feb 14 '17 at 13:24
  • What line is throwing that error? With how weird this one is, I would probably try checking my `browser`, `chromedriver`, and possibly `webdriver` versions first. Have you tried in another browser? – mrfreester Feb 14 '17 at 14:27
  • `sel.selectByVisibleText("Status");` While selecting value am getting the above error, I tried with all possibilities like selectByValue(), SelectByIndex(), and selectByVisibleText();. – z_1_p Feb 14 '17 at 17:37
  • I tried by **FirefoxDriver**, code is working fine. Only for **ChromeDriver** am getting this `org.openqa.selenium.WebDriverException: unknown error: a.tagName.toUpperCase is not a function.` So Please someone suggest me what will be path-forward for this issue. – z_1_p Feb 16 '17 at 05:32

0 Answers0