2013-04-05 2 views
0

Как выполнить действие click на кнопке без «id».Selenium IDE: нажмите команду без идентификатора

<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 
Смежные вопросы