Selenium+java: Gets the value in the list(2011-08-23 17:14:48)
Tags: gossip |
Category: Selenium |
A preliminary study using the JAVA+TESTNG framework to write selenium test cases today learned several APIs:
(1) Get the values from the list on the page and print the output:
System.out.println (selenium.gettable ("xpath=/html/body/div[3]/form/table.1.1"));
The value of the 1th column of the 1th row in the output list
(2) Determine if there is a text on the page: (can only judge, can not use example failed)
Boolean Result = (selenium.istextpresent ("Small Wings"));
Selenium.setspeed ("1000");
if (Result) {
Use case success
...
}
else {
Use case failure
...
}
(3) Assert:
ASSERT (parameter); Note that this assert is a key word in Java;
If the argument is true, the use case continues;
The parameter is false, then fails, use case failed;
Selenium+java: Gets the value in the list