Selenium_webdriver+java+testng Getting Started UI Automation

Source: Internet
Author: User
Tags testng

Web UI Automation testing requires work: Eclipse (Java compiler), selenium (library file), Webdriver (browser-driven), testng Lib;

First step: Deploy the Bad environment first, download Selenium's Selenium-server-standalone-3.8.1.jar package, import into eclipse;

Step Two:
Install three major browser driver driver (Firefox, CHROME, respectively). IE, you can download one of them)

1.chromedriver:https://code.google.com/p/chromedriver/downloads/list

2.Firefox Drive geckodriver:https://github.com/mozilla/geckodriver/releases/

3.IE Drive iedriver:http://www.nuget.org/packages/selenium.webdriver.iedriver/

Step Three:

TestNG Lib: Drag directly into eclipse
Http://marketplace.eclipse.org/content/testng-eclipse

Fourth step: Establish TestNG class;

Use of annotations: managing the execution of use cases through annotations,
@beforeMethod: A statement executed before a use case executes: a fairly environment-friendly configuration
@afterMethod: After the execution of the use case, the execution of the statement, quite a recovery of the environment
@test: The body of a use case

Then write the test case;

Fifth step: Create an XML file to specify the order of execution

Finally, we can see the results and reports of the implementation;

After execution, the results of use cases can be seen in the console of Eclipse, in more detail in the working directory Test-outputz
e:\android\testngtest\test-output:emailable-report.html;index.html;

Selenium_webdriver+java+testng Getting Started UI Automation

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.