从DROP DOWN List中选择一个值,隐藏值

时间:2015-02-24 13:10:00

标签: selenium selenium-webdriver

我在下拉列表中有一个搜索按钮。

我想点击搜索图标,然后使用鼠标从显示的下拉列表中选择一些值。

这是我的代码 -

  1. DropDown的ID

    WebElement objSpanElement = driver.findElement(ByXPath.xpath(".//*[@id='cboCargoReleases_TabCargoRelease_CustomerID']"));

  2. 这是下拉列表所属的类'objSpanElement.findElement(By.className("clsOWPAComboBox_Style_TextBox")).clear();'

  3. 这是搜索按钮ID

    “objSpanElement.findElement(By.className( ”clsOWPAComboBox_Style_DropDownButton_Search“))上单击();`

  4. 下拉列表的值在表格中,这就是我们看到它背后的代码时的样子

    <div class="clsOWPAComboBox_Style_DropDownList" style="position: absolute;   top: 447px; left: 353px; overflow: auto; visibility: visible; height: 150px;   width: 207px; z-index: 100;">
     <table width="100%" cellspacing="0" cellpadding="0">
    <tbody>
    <tr>
    <tr>
    <td class="clsOWPAComboBox_Style_DropDownListItem_MouseOver"    nowrap="">005203 - GLOBAL METAL INC</td>
    </tr>
    

0 个答案:

没有答案
相关问题