1. Select From Listid=sourceConnoracle_source
從下拉框選取值。
2. Select Radio button name value
選擇單選框。也可以點擊開此單選框然后Click Element.
I had similar issues with select drop downs and i tried this and worked for me.
click element xpath=//select[@id="reason"] wait until element is visible xpath=//option[contains(text(),'${label}')] click element xpath=//option[contains(text(),'${label}')]
If you want to select any static value form the list.
click element xpath=//select[@id="reason"] click element xpath=//select/option[0]
You can also use text equal,
click element xpath=//option[text()='${label}')]
To ignore blank,
click element xpath=//option[normalize-space(text())='Assume']
3. Select Window
關鍵字: Select Select Select Select Select Select Select WindowWindowWindowWindowWindow 參數: Locator=none 描述: 選取窗口。 如果窗口找到,那么所有乊后使用的命令均作用亍該窗口,知道該關鍵字再次使用。 如果未找到窗口,該關鍵字執行失敗。 默認情況下,當提供locator的值,它將不window的title和window的javascript的名稱迚行匹配。 當打開多個windows窗口時,如果查詢條件一致,那么默認選擇第一個。 特殊一些的情況有main(default),它將被使用在定位主窗口時。 當然Selenium2Library也提供一些特殊的窗口定位目錄: 目錄 示例 描述 Title select window/title=a 通過窗口title匹配 Name select window/name=${b} 通過窗口java腳本名稱匹配 Url select window/url=c 通過窗口當前URL匹配
4. Mouse over
關鍵字: Mouse Over 參數: locator 描述: 模擬鼠標懸停勱作。 定位使用Element元素的ID和Name屬性
當需要點擊下拉列表的元素時,需要先用次方法懸浮在列表只上,然后點擊。
5. Drag and Drop
關鍵字: Drag And Drop 參數: source, target 描述: 拖拽被定位element資源。 Element可被移勱到其他目標參數乊上。 目標為一個元素定位器,可以將對象拖拽並放下。
當需要拖動的操作時,可以用此方法。將元素source拖動至target。