0% found this document useful (0 votes)
37 views6 pages

Selenium Guideline: Standalone-X.x.x.jar

This document provides instructions for setting up a Selenium testing environment in Eclipse using TestNG. It describes how to install the necessary Java Development Kit (JDK), Eclipse, TestNG plugin, and Selenium libraries. It then explains how to configure a Selenium-TestNG project by importing existing projects, adding required JAR files, and defining the project structure with base classes for actions and test modules. Finally, it outlines how to create a test module class, run and debug tests, and view results in the test-output folder.

Uploaded by

Ngoc Phan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views6 pages

Selenium Guideline: Standalone-X.x.x.jar

This document provides instructions for setting up a Selenium testing environment in Eclipse using TestNG. It describes how to install the necessary Java Development Kit (JDK), Eclipse, TestNG plugin, and Selenium libraries. It then explains how to configure a Selenium-TestNG project by importing existing projects, adding required JAR files, and defining the project structure with base classes for actions and test modules. Finally, it outlines how to create a test module class, run and debug tests, and view results in the test-output folder.

Uploaded by

Ngoc Phan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Selenium Guideline

1. Setup environment
a. Install JDK 6 or later
b. Install Eclipse
c. Install TestNG plugin for Eclipse from
http://testng.org/doc/download.html
d. Download Selenium libraries for Java from
http://www.seleniumhq.org/download/
Selenium Standalone Server: selenium-serverstandalone-x.x.x.jar
Selenium Client and Webdriver: selenium-java-x.x.x.jar
2. How to work with Selenium-TestNG project
a. Configure project
Import Selenium-TestNG:
o From Eclipse, you selects: File->Import-> select
General/Existing Projects into Workspace ->Next>Browser to Selenium folder->Finish
Add the selenium libraries for Selenium-TestNG project
o From Eclipse, right click on Selenium-TestNG->Properties> Select Java Build Path-> Open Libraries tab->Add
External JARS-> browser to selenium libraries
(selenium-server-standalone-x.x.x.jar, seleniumjava-x.x.x.jar) -> OK

b. Structure of Selenium-TestNG project

selenium package
o SeleniumActionBase.java: Including the selenium action
(API) which helps you interact with UI (web element) such
as click, enter, get text,
o SeleniumBrowserBase.java: Including the selenium action
(API) which help you interact with browser (IE, Firefox,
Chrome) such as close browser, navigate, close browser,

testmodule package
o Including the test module that you create such as
TM_CreateIssue.java, TM_Login.java
test-output
o Including the test results after running test module. You
can get more information of test result from this folder
c. How to create a test module
From eclipse, right click on testmodule package->New>Class->Enter class name (e.g: TM_Demo)->Finish. After
finishing, the class look like as image below:

Next, you must add 2 methods which are setup,


tearDown and at least a test method. Following image
below for more details

d. Run/debug test module and get result


In order to run test module, right-click on test module
(TM_Demo)->Run As->TestNG Test

In order to debug test script:


o Toggle breakpoint

o Then right-click on test module (TM_Demo)->Debug As>TestNG Test

Get result: After running the test module, you can refer to
test-output folder to get test result
o The file of test result: // test-output/ index.html

You might also like