Selenium is an open-source robotized testing suite for Webapp. It
underpins the greater part of the programs and stages. You can create test
contents by means of record/playback, or compose the test contents in one of
the dialects, for example, Java, C#, Perl, Python, PHP and Ruby.
Selenium computerizes acknowledgment testing for Webapp by
mimicking a client's connection with the Webapp through remotely controlled Web
program. There are at present two adaptations: Selenium 1 (or Selenium RC) and
Selenium 2 (or Selenium WebDriver). Selenium 2 makes guide calls to program by
means of program's local help; while Selenium 1 infuses JavaScript capacities,
which has certain impediments.
The Selenium
suite comprises of the accompanying instruments/segments:
1. Selenium IDE:
a firefox module for recording/playback tests.
2. Selenium 1
(or Selenium RC)
3. Selenium 2
(or Selenium WebDriver)
4. Selenium
Grid: For running parallel tests.
Selenium
IDE:-
You can compose your Selenium test contents by hand utilizing one
of the programming dialects, for example, Java, C#, PHP, Perl, Python or Ruby;
however the most straightforward path is to utilize the "Selenium IDE
Firefox module" to record and create test contents. Selenium IDE is a prototyping
instrument for building test contents. It has an account include, which could
record client activities as they are performed. You could run the recorded
tests or fare them as a reusable test content in one of programming dialects
(Java, C#, Python, Perl, PHP, and Ruby) that can be upgraded and executed.
Introducing
Selenium IDE Firefox module:
Begin Firefox, goto http://www.seleniumhq.org/download/and click
"Selenium IDE" to introduce the module. Restart firefox.
You may introduce extra modules, for example, "PHP
Formatter" on the same download page.
Beginning
with Selenium IDE:-
Login-Success
Test:
To record a test for login-achievement work (utilizing Selenium
IDE Firefox module Tool):
1. Start
firefox.
2. Start the
Selenium IDE module, by tapping the "Selenium IDE" catch added to
Firefox. The Selenium Control Panel shows up. In "Base URL", enter
http://localhost/, which fills in as the base URL for every one of the
references in the content.
3. Start chronicle
by tapping the "Record" catch on the upper right corner (if recording
isn't begun).
4. In the
Firefox program, enter web interface http://localhost/login.php; enter
"test" as "username", "pwcorrect" as "secret
word"; and tap the submit catch.
5. Stop the
chronicle.
6. Study the
test summons recorded. Tap the "Source" tab, which demonstrates the
recorded charges in a HTML test content.
7. To run the
recorded orders, tap the "run" catch.
8. Next, add
state orders to check the operation. Right-tap on the summon board ⇒ Insert new
charge ⇒ Enter "assertLocation"
in "Order" and "http://localhost/main.php" in
"Target".
9. Rerun the
test orders.
10. Save the test
content as a HTML document (e.g., LoginSuccessTest.html).
11. You can
likewise trade the test in one of the programming dialects. Select
"Record" menu ⇒ "Fare Test Case as" ⇒ pick your
programming dialect/test structure/Selenium, for example, Java/JUnit4/WebDriver
or PHP (PHPUnit). Concentrate the traded test content.
Login-Failure
Test:
·
Start chronicle a test.
·
Enter "testwrong" as username; "pwwrong" as
secret key; and submit.
·
Insert New Command ⇒ In charge,
enter "assertTextPresent"; in esteem, enter "Wrong username or
secret word!”
·
Run the test.
·
Save the test as a HTML record
·
Export to your decision of programming dialect.
Usually
utilized Commands:
·
open:
·
click/clickAndWait:
·
waitForPageToLoad:
·
waitForElementToLoad:
Usually
utilized Assert and Verification Commands:-
"Attest" fizzles the test and prematurely end the
present experiment; while "confirm" falls flat the test, yet keep on
running the experiment.
·
verifyTitle/assertTitle: checks the normal page title an incentive
in <title>.
·
verifyTextPresent:
·
verifyElementPresent:
·
verifyText:
·
[TODO]
Selenium 2
(Selenium WebDriver):-
Introducing
Selenium WebDriver for Java
Selenium WebDriver is accessible in numerous dialects, for
example, Java, C#, Python, Perl, PHP and Ruby. I might portray the Java
variant.
1. From
http://www.seleniumhq.org/download/, under "Selenium Client and WebDriver
Language Bindings", Select "Java" download
"selenium-java-2.##.0.zip".
2. Unzip your
preferred download record into an envelope
(e.g.,/usr/neighborhood/selenium-2.##.0).
Beginning
with Selenium WebDriver:-
·
Launch Eclipse, make another Java venture (say SeleniumTest).
·
Include Selenium JAR record: Right-tap on the task ⇒ Properties ⇒ Java Build
Path ⇒ Libraries ⇒ ADD External
JARs ⇒ explore to
"selenium-2.##.0" and select "selenium-java-2.##.0.jar".
·
Repeat the above advance to incorporate all the JAR record in the
"libs" catalog.
·
For Firefox and HTMLUnit, you don't have to introduce any driver.
For IE, Chrome, Safari and different programs, you have to introduce the
fitting driver from Selenium Download website.
About Author:
One
of the best selenium
training institutes in Bangalore is INFOCAMPUS. It offers selenium training
which designed according to current IT Industry. Infocampus is an institute for
selenium
training in Bangalore. Free demo classes with free real time projects will
be provided. Visit http://infocampus.co.in/best-selenium-testing-training-center-in-bangalore.html or
contact 9738001024 to get more details on selenium
training.
No comments:
Post a Comment