2013-04-05 60 views
0

如何在沒有「id」的按鈕上執行點擊操作。Selenium IDE:點擊不帶ID的命令

<a class="ui-button altbuttonfix" onclick="mojarra.jsfcljs(document.getElementById('productionreporttoolbar-productionReportToolBarForm'),{'productionreporttoolbar-productionReportToolBarForm-j_idt43':'productionreporttoolbar-productionReportToolBarForm-j_idt43','userId':'11448','reportName':'','statementName':'productionReport.productionReport','token':'','productionReportId':'1000274'},'report');return false" style="" href="#"> 
     View 

這是一個class類型。任何幫助表示讚賞。謝謝。

回答

0

爲什麼不只是使用類值?我使用它作爲定位器所有的時間:

Webdriver driver = new FirefoxDriver(); 
WebElement e = driver.findElement(By.className("ui-button altbuttonfix")); 
e.click(); 
0

可以使用類,以確定在這種情況下這個按鈕,它會

css=a.ui-button.altbuttonfix