Select:針對 <select>
元素進(jìn)行的操作
selectByIndex(index)
// 找到該 <select> 元素 we
WebElement we = driver.findElement(by, selector);
// 使用該元素,實(shí)例化一個(gè) Select 類(lèi)的對象 s
Select s = new Select(we);
s.selectByValue(value);
// 或者用index
s.selectByIndex(value)
鼠標事件,有關(guān)鼠標的操作,不只是單擊,有時(shí)候還要做右擊、雙擊、拖動(dòng)等操作。這些操作包含在A(yíng)ctionChains類(lèi)中。
原文轉自:http://gitbook.cn/books/58e54b57cfcd6fa52dcef1d2/index.html