How to select a row based on the color of some column in selenium
I am selecting a row in a loop as its a dynamic table. Now I have to select a value in a drop down of one column based on the bgcolor of another column. Can any one please tell how to do this.
Following is the html of td
<td bgcolor="#ffbf00" align="center" width="12px" style="border: 2px solid rgb(0, 0, 0);" class="whitetext" id="cars_0开发者_运维问答_tbl_Price_0_0"> 4</td>
or
<td bgcolor="Green" align="center" width="12px" style="border: 2px solid rgb(0, 0, 0);" class="whitetext" id="cars_2_tbl_Price_0_0"> 23</td>
and following is the html of td that i want to select based on the value of previous td
<select style="width: 180px;" class="dropdowncommon" id="engine">
You can find the following code helpful.
if (selenium.getAttribute("td@bgcolor").equalsIgnoreCase("Green")){
// Perform desired action
}
精彩评论