Академический Документы
Профессиональный Документы
Культура Документы
7. Next, we will click on the Computere & Periferice link to open the
specific page and check if the Rezultate cautate Computere Periferie text is
displayed on the page. To do this, select the Rezultate cautate Computere
Periferie text and open the context menu (right-click) and select Show All
Available Commands | assertText css=h1 Rezultate cautate Computere
Periferie:
2. In the Save As dialog box, enter the test case name as SearchTest.hml
and click on the Save button. The test will be saved with the name SearchTest.
In Selenium IDE, we can group multiple tests in a test suite. Let's create a
test suite and Selenium IDE will automatically add SearchTest to this suite:
1. Select File | Save Test Suite from the Selenium IDE main menu.
2. In the Save As dialog box, enter the test case name as
SearchAllTests.html and click on the Save button.
3. You can create and record more than one test case in a test suite.
5. The Source tab on the Selenium IDE window will now display the test in
Java:
try {
driver.switchTo().alert();
return true;
} catch (NoAlertPresentException e) {
return false;
}
}
private String closeAlertAndGetItsText() {
try {
Alert alert = driver.switchTo().alert();
String alertText = alert.getText();
if (acceptNextAlert) {
alert.accept();
} else {
alert.dismiss();
}
return alertText;
} finally {
acceptNextAlert = true;
}
}
}