Introduction to Selenium IDE
Selenium IDE (Integrated Development Environment)
I) Overview:
> It is a Test tool inward Selenium tools suite, to prepare too execute Test cases.
> It is a Firefox plug in, plant exclusively on Firefox browser.
> It provides Graphical user interface for Recording user actions using Firefox browser, too nosotros can Insert/Edit/delete statements/steps.
> Firebug too Firepath are used to inspect elements or nosotros tin utilisation Page Inspector characteristic to inspect elements.
> Selenium IDE should exclusively survive used every bit a proto typing tool.
(* We can't prepare complex attempt out cases using Selenium IDE)
Test Step inward Selenium IDE Test Case:
Syntax:
Command + Target + Value
Command - forms the functionality of the step
Target - Identifies the Element on the Web page.
Value - Input information (* This is applicable exclusively for few commands)
----------------
Example:
Type id=Email abcd123
* Selenium IDE Test example default format is .html
Selenium IDE Commands are known every bit Selenese commands.
-------------------------------------------------
II) Drawbacks of Selenium IDE:
> Supports exclusively Firefox Browser, doesn't back upwardly other browsers.
> No menstruum command statements, thus nosotros can't utilisation programming logic for enhancing attempt out cases.
> Data driven Testing is non possible.
> No centralized maintenance of Elements(Objects)
---------------------------------------
III) Selenium IDE Installation:
> Launch Firefox browser, download Selenium IDE from the seleniumhq.org website.
> Install the Selenium IDE plug in.
> Restart Firefox Browser.
> After Firefox Reboots too thus nosotros tin utilisation Selenium IDE.
-----------------------------------------------
IV) Selenium IDE Features:
> Create a Test Case / Test Suite
(We tin create Test cases either By Recording user actions on AUT or By Typing Test steps manually)
> Edit Test Cases (Insert/Modify/Delete steps)
> Execute a Test Case / Test Suite
> Debug Test Cases using Breakpoints.
> Insert Comments.
-----------------------------
Menus inward Selenium IDE:
1) File Menu:
File card has options for Test Case too Test Suite.
Using this menu:
> Create New Test Case
> Open Existing Test Case
> Save Test Case
> Export Test example inward a linguistic communication of our choice.
Note: All these options available for Test suite also.
-------------------------------
2) Edit menu:
It has Editor Commands;
Copy
cut
paste
delete
undo etc... for editing attempt out steps.
Insert novel command
Insert novel comment etc...
------------------------------
3) Actions
It has options for,
Record too Run Test case, Run Test suite,
Insert/Remove Breakpoints,
Pause/Resume Test execution etc...
--------------------------------
4) Options
Options card allows us to alter settings, nosotros tin laid upwardly timeout value etc...
-------------------
5) Help menu:
It provides aid documents for selenium IDE:
------------------------------------------
Test Case Pane:
Our Test Script is displayed inward the Test example Pane:
It has two tabs:
i) Table format (It displays commands too parameters)
ii) Source format (Displays Test example inward the native format (html format)
----------------------------------------
V) Create Test Cases inward Selenium:
i) Recording:
During Recording it generates steps (Command too Target) for every user activeness on AUT. It tin generate verification points also.
ii) Type Test steps manually
Using Selenium IDE commands /Selenese commands too Element locators nosotros tin type Test steps.
-----------------------------------------------------
VI) Important Selenium IDE Commands:
A command tells Selenium what to do. Selenium commands come upwardly inward 3 flavors: Actions, Accessors, too Assertions.
i) Actions are commands that to a greater extent than frequently than non manipulate the solid soil of the application. They exercise things similar “click this link” too “select that option”. If an Action fails, or has an error, the execution of the electrical current attempt out is stopped.
ii) Accessors examine the solid soil of the application too shop the results inward variables, e.g. “storeTitle”. They are also used to automatically generate Assertions.
iii) Assertions are similar Accessors, but they verify that the solid soil of the application conforms to what is expected. Examples include “make certain the page championship is X” too “verify that this checkbox is checked”.
Assertion vs. Verification
An “assert” volition neglect the attempt out too abort the electrical current attempt out case, whereas a “verify” volition neglect the attempt out too maintain to run the attempt out case.
Commonly Used Selenese Commands:
open -opens a page using a URL.
click/clickAndWait -performs a click operation, too optionally waits for a novel page to load.
verifyTitle/assertTitle -verifies an expected page title.
verifyTextPresent -verifies expected text is somewhere on the page.
verifyElementPresent -verifies an expected UI element, every bit defined past times its HTML tag, is acquaint on the page.
verifyText -verifies expected text too its corresponding HTML tag are acquaint on the page.
verifyTable -verifies a table’s expected contents.
waitForPageToLoad -pauses execution until an expected novel page loads. Called automatically when clickAndWait is used.
waitForElementPresent -pauses execution until an expected UI element, every bit defined past times its HTML tag, is acquaint on the page.
---------------------------------------------------------------
VII) Selenium IDE Vs. Selenium WebDriver inward example of Test Steps:
In Selenium IDE Test Cases tin survive created using Element Locators (id/name/link/xpath) too Selenese commands,
Test Step Syntax:
Command + Target + Value
Note: Value is exclusively for a few commands.
Examples:
type name=username abcds123
click id=ok
--------------------------
In Selenium WebDriver Test Cases tin survive created using Element Locators(id/name/linkText/partialLinkText/className/tagName/cssSelector/xpath) too WebDriver Commands/Methods.
Test Step Syntax:
driverObject.webDriverCommand(By.ElementLocator("Locator Value")).WebDriverCommand/Method();
Examples:
driver.findElement(By.name("username")).sendkeys("abcd123");
driver.findElement(By.id("Sign In")).click();
----------------------------------------------------------------
Selenium IDE (Integrated Development Environment)
I) Overview:
> It is a Test tool inward Selenium tools suite, to prepare too execute Test cases.
> It is a Firefox plug in, plant exclusively on Firefox browser.
> It provides Graphical user interface for Recording user actions using Firefox browser, too nosotros can Insert/Edit/delete statements/steps.
> Firebug too Firepath are used to inspect elements or nosotros tin utilisation Page Inspector characteristic to inspect elements.
> Selenium IDE should exclusively survive used every bit a proto typing tool.
(* We can't prepare complex attempt out cases using Selenium IDE)
Test Step inward Selenium IDE Test Case:
Syntax:
Command + Target + Value
Command - forms the functionality of the step
Target - Identifies the Element on the Web page.
Value - Input information (* This is applicable exclusively for few commands)
----------------
Example:
Type id=Email abcd123
* Selenium IDE Test example default format is .html
Selenium IDE Commands are known every bit Selenese commands.
-------------------------------------------------
II) Drawbacks of Selenium IDE:
> Supports exclusively Firefox Browser, doesn't back upwardly other browsers.
> No menstruum command statements, thus nosotros can't utilisation programming logic for enhancing attempt out cases.
> Data driven Testing is non possible.
> No centralized maintenance of Elements(Objects)
---------------------------------------
III) Selenium IDE Installation:
> Launch Firefox browser, download Selenium IDE from the seleniumhq.org website.
> Install the Selenium IDE plug in.
> Restart Firefox Browser.
> After Firefox Reboots too thus nosotros tin utilisation Selenium IDE.
-----------------------------------------------
IV) Selenium IDE Features:
> Create a Test Case / Test Suite
(We tin create Test cases either By Recording user actions on AUT or By Typing Test steps manually)
> Edit Test Cases (Insert/Modify/Delete steps)
> Execute a Test Case / Test Suite
> Debug Test Cases using Breakpoints.
> Insert Comments.
-----------------------------
Menus inward Selenium IDE:
1) File Menu:
File card has options for Test Case too Test Suite.
Using this menu:
> Create New Test Case
> Open Existing Test Case
> Save Test Case
> Export Test example inward a linguistic communication of our choice.
Note: All these options available for Test suite also.
-------------------------------
2) Edit menu:
It has Editor Commands;
Copy
cut
paste
delete
undo etc... for editing attempt out steps.
Insert novel command
Insert novel comment etc...
------------------------------
3) Actions
It has options for,
Record too Run Test case, Run Test suite,
Insert/Remove Breakpoints,
Pause/Resume Test execution etc...
--------------------------------
4) Options
Options card allows us to alter settings, nosotros tin laid upwardly timeout value etc...
-------------------
5) Help menu:
It provides aid documents for selenium IDE:
------------------------------------------
Test Case Pane:
Our Test Script is displayed inward the Test example Pane:
It has two tabs:
i) Table format (It displays commands too parameters)
ii) Source format (Displays Test example inward the native format (html format)
----------------------------------------
V) Create Test Cases inward Selenium:
i) Recording:
During Recording it generates steps (Command too Target) for every user activeness on AUT. It tin generate verification points also.
ii) Type Test steps manually
Using Selenium IDE commands /Selenese commands too Element locators nosotros tin type Test steps.
-----------------------------------------------------
VI) Important Selenium IDE Commands:
A command tells Selenium what to do. Selenium commands come upwardly inward 3 flavors: Actions, Accessors, too Assertions.
i) Actions are commands that to a greater extent than frequently than non manipulate the solid soil of the application. They exercise things similar “click this link” too “select that option”. If an Action fails, or has an error, the execution of the electrical current attempt out is stopped.
ii) Accessors examine the solid soil of the application too shop the results inward variables, e.g. “storeTitle”. They are also used to automatically generate Assertions.
iii) Assertions are similar Accessors, but they verify that the solid soil of the application conforms to what is expected. Examples include “make certain the page championship is X” too “verify that this checkbox is checked”.
Assertion vs. Verification
An “assert” volition neglect the attempt out too abort the electrical current attempt out case, whereas a “verify” volition neglect the attempt out too maintain to run the attempt out case.
Commonly Used Selenese Commands:
open -opens a page using a URL.
click/clickAndWait -performs a click operation, too optionally waits for a novel page to load.
verifyTitle/assertTitle -verifies an expected page title.
verifyTextPresent -verifies expected text is somewhere on the page.
verifyElementPresent -verifies an expected UI element, every bit defined past times its HTML tag, is acquaint on the page.
verifyText -verifies expected text too its corresponding HTML tag are acquaint on the page.
verifyTable -verifies a table’s expected contents.
waitForPageToLoad -pauses execution until an expected novel page loads. Called automatically when clickAndWait is used.
waitForElementPresent -pauses execution until an expected UI element, every bit defined past times its HTML tag, is acquaint on the page.
---------------------------------------------------------------
VII) Selenium IDE Vs. Selenium WebDriver inward example of Test Steps:
In Selenium IDE Test Cases tin survive created using Element Locators (id/name/link/xpath) too Selenese commands,
Test Step Syntax:
Command + Target + Value
Note: Value is exclusively for a few commands.
Examples:
type name=username abcds123
click id=ok
--------------------------
In Selenium WebDriver Test Cases tin survive created using Element Locators(id/name/linkText/partialLinkText/className/tagName/cssSelector/xpath) too WebDriver Commands/Methods.
Test Step Syntax:
driverObject.webDriverCommand(By.ElementLocator("Locator Value")).WebDriverCommand/Method();
Examples:
driver.findElement(By.name("username")).sendkeys("abcd123");
driver.findElement(By.id("Sign In")).click();
----------------------------------------------------------------