2013-04-05 103 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