2014-03-04 67 views
0

有一個下拉菜單,啓用和禁用了2個值,但該字段有type =按鈕。 我不確定如何在此下拉列表中選擇值。使用硒選擇下拉值RC

下面是元素

<button id="loggingTargetStatus" class="dijitReset dijitStretch dijitButtonContents dijitDownArrowButton" waistate="haspopup-true,labelledby-loggingTargetStatus_label" wairole="button" dojoattachpoint="focusNode,titleNode,_arrowWrapperNode" value="" type="button" role="button" aria-haspopup="true" aria-labelledby="loggingTargetStatus_label" tabindex="0" style="-moz-user-select: none;"> 
<span class="dijitReset dijitInline cpmIconStateEnable" dojoattachpoint="iconNode"></span> 
<span id="loggingTargetStatus_label" class="dijitReset dijitInline dijitButtonText" dojoattachpoint="containerNode,_popupStateNode">Enabled</span> 
<span class="dijitReset dijitInline dijitArrowButtonInner"> </span> 
<span class="dijitReset dijitInline dijitArrowButtonChar">▼</span> 
</button> 

的HTML代碼,請建議如何使用硒RC

+0

[tag:selenium-rc]現在已被棄用了幾年。你無法升級到[tag:selenium-webdriver]?你知道[tag:selenium2]支持這兩種API。 – SiKing

回答

0

這不是一個select元素來選擇,所以你不能用它作爲這樣的互動。它可能使用AJAX使其像看起來像選擇菜單

您需要在所有適當的元素上使用click()。自從我使用以來,已經有好幾年了,所以下面的代碼可能需要進行調整。

selenium.click("loggingTargetStatus"); // to enable the menu 
selenium.click(your_field); // you will have to find the correct locator