Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.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
Html 从Selenium中的下拉列表中选择_Html_Selenium_Selenium Webdriver - Fatal编程技术网

Html 从Selenium中的下拉列表中选择

Html 从Selenium中的下拉列表中选择,html,selenium,selenium-webdriver,Html,Selenium,Selenium Webdriver,我是selenium的新手,我正在尝试从下拉列表中选择一个选项。以下是下拉列表的HTML: <input type="text" ng-blur="getInventoryStatus()" typeahead-on-select="onDeviceSelect($item)" typeahead="device as device.name for device in deviceList| filter:$viewValue |orderBy:'name':false"

我是selenium的新手,我正在尝试从下拉列表中选择一个选项。以下是下拉列表的HTML:

 <input type="text" ng-blur="getInventoryStatus()" 
  typeahead-on-select="onDeviceSelect($item)" 
  typeahead="device as device.name for device in deviceList| filter:$viewValue |orderBy:'name':false" 
  ng-model="deviceSearch" placeholder="SKU / Item Name" class="form-control 
  ng-pristine ng-valid" autocomplete="off" aria-autocomplete="list" 
   aria-expanded="false" aria-owns="typeahead-00F-1916">
我已经尝试了几乎所有的方法,我可以在互联网上找到,但没有工作。 我试图使用
Select
类,包装了
WebElement
,但它抛出了一个异常
nosucheelement

我试图丢失列表中的所有选项,但在这种情况下得到了异常
ui。意外的TagNameException.Element
应该有标记
Select
,但它有
输入
。我需要使用
xpath
作为findelements的标识符


请在这方面帮助我。

如果下拉元素是可编辑字段,则此操作有效:

driver.findElement("dropdown rlement").sendKeys("your value");

这里没有HTML。我也有这些问题,但现在记不起解决方案了。尝试使用javascript
jQuery。单击()选择选项。选择“不起作用”。请检查
findElement(By.xpath(//input[@placeholder='SKU/Item Name'])
是否返回一个元素?findElement(By.xpath(//…)在我能够单击该元素时返回该元素@维维克辛汉克斯。这很好用。Sendkeys您所需的值,所需的值显示在下拉列表中。现在只需单击下拉列表中的选项。非常感谢:)
driver.findElement("dropdown rlement").sendKeys("your value");