Selenium+java: Gets the value in the list

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.