![]()
How To Run Selenium Script In Eclipse
How
To Run Selenium Script In Eclipse
Selenium:
Selenium is a portable software
testing framework for web
applications Selenium provides a record/playback tool for authoring tests
without learning a test scripting language.
Selenium is an open
source tool for web application testing. This tool is primarily developed in
Java Script and browser technologies and hence supports all the major browsers
on all the platforms.
Selenium IDE:
Selenium IDE is an integrated development environment for
Selenium scripts. It is implemented as a Firefox extension, and allows you to
record, edit, and debug tests.
Selenium
Remote Control:
Selenium Remote Control (RC) is a test tool that allows you to write
automated web application UI tests in any programming language against any HTTP
website using any mainstream JavaScript-enabled browser.
Why
Selenium:
·
Its Open source!!
·
It’s easy to learn and implement.
·
Supports multiple browsers.
·
Supports multiple scripting/programming languages.
·
Flexible to your choice, simple record and playback (IDE), Complex
Framework design to your choice by using your favorite programming language.
Here I would like to share how to run the
selenium script in Eclipse.
Steps
to run the selenium script in eclipse:
Step 1:
Download required components
1. Download Eclipse IDE: http://www.eclipse.org/downloads/
2. Download Selenium RC: http://seleniumhq.org/download/
3. Download JUnit: http://www.junit.org/
Step 2: Record and save the
java selenium script
·
Open Firefox and enter the
URL to browse your application.
·
Launch IDE from Tool menu.
·
Record your script.
·
Choose the programming
language as JAVA and save your script. To choose the language, go to
Option-> Clipboard format and select JUnit 3 (Remote Control).
·
Now you have a java code. I
am making it simple and not covering scripting in detail. My motive is to share
you the end to end process of using this IDE and RC to run a simple test using
Eclipse. Rest you can change your script as per your need.
Step 3: Create a java project in Eclipse
The first step in eclipse
is to create a java project to do this follow the steps below
·
Launch Eclipse.
·
Click on File > New >
others > select java project.
·
Enter the java project name
as FirstProject (for example).
·
Click on finish button.
Step 4: Add selenium
java client jar and JUnit library to your project
·
Right
click the project and select the properties.
·
Go
to java build path and select libraries tab.
·
Click
add external jars.
·
Browse
and add the selenium-java-client-driver.jar and junit4.jar from the source
where you had saved it.
Step 5: Initiating the Selenium Server
·
Open
the command prompt and run the selenium RC by below command.
·
D:\selenium-remote-control-1.0.3\selenium-server-1.0.3>
java -jar selenium-server.jar
·
After entering that command, the selenium server will
start in your machine.
Step 6: Adding your test script in our Project
To
add your test (which you have saved earlier) as a java class file to the
project (FirstProject, already saved) follow the below steps:
·
In eclipse right click the project FirstProject
select new > class
·
Enter the class name as MyFirstTest.
·
Paste
the recorded code from the file you had saved it.
·
Choose
"com.thoughtworks.selenium.SeleneseTestCase" as its super class.
·
Finish
it.
Step 7: Modifying your test script
Once
you are done with your class file, it will look like,
Package.*
import
com.thoughtworks.selenium.SeleneseTestCase ;
public class MyFirstTest extends
SeleneseTestCases {
public void setUp() throws Exception {
setUp( " http://www.google.com/
" , "*firefox”);
}
//............ Your test
script..............
public void testUntitled() throws
Exception {
selenium.open("http://www.google.com/");
assertEquals("Google",
selenium.getTitle());
selenium.type("id=lst-ib",
"selenim");
selenium.click("name=btnG");
}
}
In case you want to run this in
different browser then simply you can change your script.
setUp( "
http://www.google.com/ " , "*firefox”); to setUp( "http://www.google.com/ " , "*chrome”); or whatever browser
you need to run.
Step 8: Running your test
Finally we are ready to run
our first test. To run this in eclipse you click on Run button. Select option
Run as "JUnit Test”.
Note: One thing I forgot to
mention that if you have eclipse with JRE version lower than 1.5 in build path,
it will show some error related to version not supporting. To resolve this you
have to remove the default Eclipse JRE and add JRE version 1.5 or more to System
Library in Build Path.
To add this follows the steps:
·
Go
to Java Build path and select Libraries tab.
·
Under
this select JRE system Library.
·
Remove
your default one.
·
Now
click on add Library and select JRE system Library and click next.
·
Add
JRE.
·
Now
add this JRE to your class path.
So finally I am done with your end
to end execution of java test script using selenium RC in Eclipse.
- All
- Agile Testing
- Bug/Defect
- Certification
- Conferences
- Database Testing
- Functional Test
- Integration Testing
- Interview
- Java Testing
- Magazine
- Manual Testing
- Methodology
- Mobile Testing
- Network Testing
- Performance Test
- Requirement
- Review
- Risk Management
- Security Testing
- Software Testing
- Standard
- System Testing
- Test Automation
- Test Case
- Test Data
- Test Environment
- Test Estimation
- Test Management
- Tester Career
- Testing News
- Test Plan
- Unit Testing
- Video Tutorial
- Web Testing
- Webinar
| Number | Title | Author | Date | Votes | Views |
| 20614 |
Best foreign films to start with?
Bobbytrern
|
2026.07.10
|
Votes 0
|
Views 8371348
|
Bobbytrern | 2026.07.10 | 0 | 8371348 |
| 20613 |
SileniusStor is specialized in reselling Cheap Aquafadas software online.
Softwareces
|
2022.09.15
|
Votes 0
|
Views 67067955
|
Softwareces | 2022.09.15 | 0 | 67067955 |
| 20612 |
CSStore is specialized in reselling Cheap Steinberg software online.
Softwareces
|
2022.09.04
|
Votes 0
|
Views 67042259
|
Softwareces | 2022.09.04 | 0 | 67042259 |
| 20611 |
Software Tester Community Website
ItSeTsQtBer
|
2021.04.11
|
Votes 0
|
Views 67507760
|
ItSeTsQtBer | 2021.04.11 | 0 | 67507760 |
| 20610 |
SoapUI Certification Course Content
Steveskok
|
2021.02.08
|
Votes 0
|
Views 68184459
|
Steveskok | 2021.02.08 | 0 | 68184459 |
| 20609 |
JavaScript Course Content
Steveskok
|
2021.02.08
|
Votes 0
|
Views 67847306
|
Steveskok | 2021.02.08 | 0 | 67847306 |
| 20608 |
Why most mobile testing is not continuous?
(TestExpert)
|
2021.02.04
|
Votes 0
|
Views 67924670
|
(TestExpert) | 2021.02.04 | 0 | 67924670 |
| 20607 |
8 Common Mistakes When Planning and Documenting Your Tests
(TestExpert)
|
2021.02.04
|
Votes 0
|
Views 69559993
|
(TestExpert) | 2021.02.04 | 0 | 69559993 |
| 20606 |
Types of Performance Testing
Jamessmith
|
2021.01.17
|
Votes 0
|
Views 68598985
|
Jamessmith | 2021.01.17 | 0 | 68598985 |
| 20605 |
How to Build E2E Test Cases (1)
tanthanh
|
2020.05.28
|
Votes 0
|
Views 68025339
|
tanthanh | 2020.05.28 | 0 | 68025339 |
| 20604 |
[White Paper] Delivering better software using Test Automation
tanthanh
|
2020.05.28
|
Votes 0
|
Views 68433812
|
tanthanh | 2020.05.28 | 0 | 68433812 |
| 20603 |
[Whitepaper] How to choose the right API Testing Solution
tanthanh
|
2020.05.28
|
Votes 0
|
Views 68015909
|
tanthanh | 2020.05.28 | 0 | 68015909 |
| 20602 |
[Whitepaper] How to choose the right API Testing Solution
tanthanh
|
2020.05.28
|
Votes 0
|
Views 67863806
|
tanthanh | 2020.05.28 | 0 | 67863806 |
| 20601 |
TestOps Introduction
VTB
|
2020.03.23
|
Votes 0
|
Views 66635335
|
VTB | 2020.03.23 | 0 | 66635335 |
| 20600 |
TestOps Implementation Case Study
VTB
|
2020.03.23
|
Votes 0
|
Views 68108305
|
VTB | 2020.03.23 | 0 | 68108305 |
| 20599 |
Selenium Automation Tester Certification Sample Exam Set 3
(TestExpert)
|
2020.02.03
|
Votes 0
|
Views 68178071
|
(TestExpert) | 2020.02.03 | 0 | 68178071 |
| 20598 |
Selenium Automation Tester Certification Sample Exam Set 2
(TestExpert)
|
2020.02.03
|
Votes 0
|
Views 68197533
|
(TestExpert) | 2020.02.03 | 0 | 68197533 |
| 20597 |
Selenium Automation Tester Certification : Sample Exam Set 1
(TestExpert)
|
2020.02.03
|
Votes 0
|
Views 67709873
|
(TestExpert) | 2020.02.03 | 0 | 67709873 |
| 20596 |
What is agile testing? why is agile testing? and what is the benefits? (20)
oishichip
|
2019.12.26
|
Votes 0
|
Views 67078658
|
oishichip | 2019.12.26 | 0 | 67078658 |
| 20595 |
Crowd Testing — Vantagens para testadores, plataformas e clientes [pt-br]
soikmd2
|
2019.12.14
|
Votes 0
|
Views 67129795
|
soikmd2 | 2019.12.14 | 0 | 67129795 |
| 20594 |
Software Testing Industry Report (Turkey) 2018-2019 (2)
ItSeTsQtB
|
2019.08.08
|
Votes 0
|
Views 68046952
|
ItSeTsQtB | 2019.08.08 | 0 | 68046952 |
| 20593 |
How to bypass security in integration tests in ASP.Net Core
ItSeTsQtB
|
2019.08.08
|
Votes 0
|
Views 69256228
|
ItSeTsQtB | 2019.08.08 | 0 | 69256228 |
| 20592 |
For agile testing, fail fast with test impact analysis
ItSeTsQtB
|
2019.08.08
|
Votes 0
|
Views 68469461
|
ItSeTsQtB | 2019.08.08 | 0 | 68469461 |
| 20591 |
Career Path in Software Testing
^Software^
|
2019.07.28
|
Votes 0
|
Views 67790094
|
^Software^ | 2019.07.28 | 0 | 67790094 |
| 20590 |
Challenges in Big Data Testing
^Software^
|
2019.07.22
|
Votes 0
|
Views 68660136
|
^Software^ | 2019.07.22 | 0 | 68660136 |
| 20589 |
Essential Necessities In Big Data Testing
^Software^
|
2019.07.22
|
Votes 0
|
Views 66568738
|
^Software^ | 2019.07.22 | 0 | 66568738 |
| 20588 |
5 Test Data Generation Techniques
^Software^
|
2019.07.22
|
Votes 0
|
Views 68125993
|
^Software^ | 2019.07.22 | 0 | 68125993 |
| 20587 |
CI and CD for ETL (Extract-Transform-Load) testing.
^Software^
|
2019.07.22
|
Votes 0
|
Views 67953296
|
^Software^ | 2019.07.22 | 0 | 67953296 |
| 20586 |
Quest for Quality Conference : 5-6 Nov 2019 at Dublin, Ireland
VTB
|
2019.07.08
|
Votes 0
|
Views 67481928
|
VTB | 2019.07.08 | 0 | 67481928 |
| 20585 |
TestBash Essentials Conference 2019
VTB
|
2019.07.08
|
Votes 0
|
Views 67682158
|
VTB | 2019.07.08 | 0 | 67682158 |
| 20584 |
UKSTAR Conference : 11-03-2019
VTB
|
2019.07.08
|
Votes 0
|
Views 66894170
|
VTB | 2019.07.08 | 0 | 66894170 |
| 20583 |
Testing in Context Conference Australia (TiCCA) 2019
VTB
|
2019.07.08
|
Votes 0
|
Views 67712051
|
VTB | 2019.07.08 | 0 | 67712051 |
| 20582 |
European Testing Conference 2019
VTB
|
2019.07.08
|
Votes 0
|
Views 67832318
|
VTB | 2019.07.08 | 0 | 67832318 |
| 20581 |
Automation Guild Online Conference 2019
VTB
|
2019.07.08
|
Votes 0
|
Views 68520067
|
VTB | 2019.07.08 | 0 | 68520067 |
| 20580 |
Software Quality Days 2019 : 15 Jan 2019 (1)
VTB
|
2019.07.08
|
Votes 0
|
Views 67730923
|
VTB | 2019.07.08 | 0 | 67730923 |
| 20579 |
Skills required to become a Software Tester (1)
IT-Tester
|
2019.07.08
|
Votes 0
|
Views 68624811
|
IT-Tester | 2019.07.08 | 0 | 68624811 |
| 20578 |
Automated Unit Testing with Randoop, JWalk and µJava versus Manual JUnit Testing
IT-Tester
|
2019.07.08
|
Votes 0
|
Views 66562579
|
IT-Tester | 2019.07.08 | 0 | 66562579 |
| 20577 |
Scrum Testing Guide Book (2)
IT-Tester
|
2019.06.26
|
Votes 0
|
Views 67301682
|
IT-Tester | 2019.06.26 | 0 | 67301682 |
| 20576 |
Acceptance Testing Definition in Testing vs Scrum
IT-Tester
|
2019.06.26
|
Votes 0
|
Views 67759112
|
IT-Tester | 2019.06.26 | 0 | 67759112 |
| 20575 |
User Acceptance Testing Checklist
VTB
|
2019.06.20
|
Votes 0
|
Views 68254005
|
VTB | 2019.06.20 | 0 | 68254005 |
| 20574 |
Firewalls and Types (1)
VTB
|
2018.11.14
|
Votes 0
|
Views 66669775
|
VTB | 2018.11.14 | 0 | 66669775 |
| 20573 |
Senior Test Engineer (1)
VTB
|
2018.11.05
|
Votes 0
|
Views 67928946
|
VTB | 2018.11.05 | 0 | 67928946 |
| 20572 |
Junior Test Analyst
kornadian2
|
2018.11.04
|
Votes 0
|
Views 67951469
|
kornadian2 | 2018.11.04 | 0 | 67951469 |
| 20571 |
Senior Test Engineer
kornadian2
|
2018.11.04
|
Votes 0
|
Views 67793259
|
kornadian2 | 2018.11.04 | 0 | 67793259 |
| 20570 |
Programme Test Manager, 12m, Immed Start, $NEG
kornadian2
|
2018.11.04
|
Votes 0
|
Views 69157452
|
kornadian2 | 2018.11.04 | 0 | 69157452 |
| 20569 |
Junior Test Analyst
kornadian2
|
2018.11.04
|
Votes 0
|
Views 68282346
|
kornadian2 | 2018.11.04 | 0 | 68282346 |
| 20568 |
Dev & Test Manager
kornadian2
|
2018.11.04
|
Votes 0
|
Views 68449884
|
kornadian2 | 2018.11.04 | 0 | 68449884 |
| 20567 |
Senior Test Analyst (Performance Tester)
kornadian2
|
2018.11.04
|
Votes 0
|
Views 68743950
|
kornadian2 | 2018.11.04 | 0 | 68743950 |
| 20566 |
QA Automation Test Analyst
kornadian2
|
2018.11.04
|
Votes 0
|
Views 67501910
|
kornadian2 | 2018.11.04 | 0 | 67501910 |
| 20565 |
Software/Field Testing Engineer
kornadian2
|
2018.11.04
|
Votes 0
|
Views 67763486
|
kornadian2 | 2018.11.04 | 0 | 67763486 |
Thank you
thank you for your instruction