Friday, July 10, 2015

Learn Selenium & QTP In Pune:- QTP & Selenium Specialist Training:- 9922500360

Classroom and Online Training QTP Classes in Pune,Delhi and Mumbai-09763315036

HP Quick Test Professional Online training from Automation Infotech 91-9763315036

Comprehensive QuickTest Professional 10.0
Course Code : QTP032012
Source : AutoamtionInfotech


HP Quick Test Professional (QTP basic to In-depth concepts + VB Scripting +

Descriptive Programming + Framework Development + Certification) Training


Please find below the QTP training details.

Training: QTP Specialist with Framework plus Certification Training

Duration: 4-5 weeks

Trainer: QTP Certified with 6+ years of experience working as Automation lead

Call 09763315036 / 9922500360



Classroom and Online Training Selenium Classes in Pune,Delhi and Mumbai-09922500360

Selenium Online training from Automation Infotech 91-9922500360

Comprehensive Selenium
Course Code : Selenium 112014
Source : AutoamtionInfotech


Selenium  basic to In-depth concepts + Java + RC + Web Driver + Grid + Framework Development  Training


Please find below the Selenium training details.

Training: Selenium Specialist with Framework plus Certification Training

Duration: 9 weeks


Call 09763315036 / 9922500360




Introduction to Selenium IDE



Selenium IDE (Integrated Development Environment) is the simplest tool in the Selenium Suite. It is a Firefox add-on that creates tests very quickly through its record-and-playback functionality. This feature is similar to that of QTP. It is effortless to install and easy to learn.
Because of its simplicity, Selenium IDE should only be used as a prototyping tool - not an overall solution for developing and maintaining complex test suites.
Though you will be able to use Selenium IDE without prior knowledge in programming, you should at least be familiar with HTML, JavaScript, and the DOM (Document Object Model) to utilize this tool to its full potential. Knowledge of JavaScript will be required when we get to the section about the Selenese command "runScript".
Selenium IDE supports autocomplete mode when creating tests. This feature serves two purposes:
  • It helps the tester to enter commands more quickly.
  • It restricts the user from entering invalid commands.

Features of Selenium IDE


Menu Bar

It is located at the topmost portion of the IDE. The most commonly used menus are the File, Edit, and Options menus.
File menu
  • It contains options to create, open, save, and close tests.
  • Tests are saved in HTML format.
  • The most useful option is "Export" because it allows you to turn your Selenium IDE test cases into file formats that can run on Selenium Remote Control and WebDriver
  • "Export Test Case As..." will export only the currently opened test case.
  • "Export Test Suite As..." will export all the test cases in the currently opened test suite.

  • As of Selenium IDE v1.9.1, test cases can be exported only to the following formats:
  • .cs (C# source code)
  • .java (Java source code)
  • .py (Python source code)
  • .rb (Ruby source code)

Edit Menu
  • It contains usual options like Undo, Redo, Cut, Copy, Paste, Delete, and Select All.
  • The two most important options are the "Insert New Command" and "Insert New Comment".

  • The newly inserted command or comment will be placed on top of the currently selected line.

  • Commands are colored black.
  • Comments are colored purple.

Options menu

It provides the interface for configuring various settings of Selenium IDE.
We shall concentrate on the Options and Clipboard Format options.

Clipboard Format

  • The Clipboard Format allows you to copy a Selenese command from the editor and paste it as a code snippet.
  • The format of the code follows the option you selected here in Clipboard Format's list.
  • HTML is the default selection.
For example, when you choose Java/JUnit 4/WebDriver as your clipboard format, every Selenese command you copy from Selenium IDE's editor will be pasted as Java code. See the illustration below.

Selenium IDE Options dialog box

You can launch the Selenium IDE Options dialog box by clicking Options > Options... on the menu bar. Though there are many settings available, we will concentrate on the few important ones.

  • Default Timeout Value. This refers to the time that Selenium has to wait for a certain element to appear or become accessible before it generates an error.  Default timeout value is 30000ms.
  • Selenium IDE extensions. This is where you specify the extensions you want to use to extend Selenium IDE's capabilities. You can visit http://addons.mozilla.org/en-US/firefox/and use "Selenium" as keyword to search for specific extensions.
  • Remember base URL. Keep this checked if you want Selenium IDE to remember the Base URL every time you launch it. If you uncheck this, Selenium IDE will always launch with a blank value for the Base URL.
  • Autostart record. If you check this, Selenium IDE will immediately record your browser actions  upon startup.
  • Locator builders.This is where you specify the order by which locators are generated while recording.Locators are ways to tell Selenium IDE which UI element should a Selenese command act upon. In the setup below, when you click on an element with an ID attribute, that element's ID will be used as the locator since "id" is the first one in the list. If that element does not have an ID attribute, Selenium will next look for the "name" attribute since it is second in the list. The list goes on and on until an appropriate one is found.

Base URL Bar


  • It has a dropdown menu that remembers all previous values for easy access.
  • The Selenese command "open" will take you to the URL that you specified in the Base URL.
  • In this tutorial series, we will be using http://newtours.demoaut.com as our Base URL. It is the site for Mercury Tours, a web application maintained by HP for web testing purposes. We shall be using this application because it contains a complete set of elements that we need for the succeeding topics.
  • The Base URL is very useful in accessing relative URLs. Suppose that your Base URL is set tohttp://newtours.demoaut.com. When you execute the command "open" with the target value "signup", Selenium IDE will direct the browser to sign-up page. See the illustration below.

Toolbar


Playback Speed. This controls the speed of your Test Script Execution.
Record.This starts/ends your recording session.  Each browser action is entered as a Selenese command in the Editor.
Play entire test suite. This will sequentially play all the test cases listed in the Test Case Pane.
Play current test case. This will play only the currently selected test case in the Test Case Pane.
Pause/Resume. This will pause or resume your playback.
Step. This button will allow you to step into each command in your test script.
Apply rollup rules. This is an advanced functionality. It allows you to group Selenese commands together and execute them as a single action.

Test Case Pane

  • In Selenium IDE, you can open more than one test case at a time.
  • The test case pane shows you the list of currently opened test cases.
  • When you open a test suite, the test case pane will automatically list all the test cases contained in it.
  • The test case written in bold font is thecurrently selected test case
  • After playback, each test case is color-coded to represent if it passed or failed.
    • Green color means "Passed."
    • Red color means "Failed."
  • At the bottom portion is a summary of the number of test cases that were run and failed.

Editor

You can think of the editor as the place where all the action happens. It is available in two views: Table and Source.
Table View

  • Most of the time, you will work on Selenium IDE using the Table View.
  • This is where you create and modify Selenese commands.
  • After playback, each step is color-coded.

  • To create steps, type the name of the command in the "Command" text box.
  • It displays a dropdown list of commandsthat match with the entry that you are currently typing.
  • Target is any parameter (like username , password) for a command and Value is the input value (like tom,123pass) for those Targets.
Source View

  • It displays the steps in HTML (default) format.
  • It also allows you to edit your scriptjust like in the Table View.

Log Pane

The Log Pane displays runtime messages during execution. It provides real-time updates as to what Selenium IDE is doing.
Logs are categorized into four types:
  • Debug - By default, Debug messages are not displayed in the log panel. They show up only when you filter them. They provide technical information about what Selenium IDE is doing behind the scenes. It may display messages such as a specific module has done loading, a certain function is called, or an external JavaScript file was loaded as an extension.
  • Info - It says which command Selenium IDE is currently executing.
  • Warn - These are warning messages that are encountered in special situations.
  • Error - These are error messages generated when Selenium IDE fails to execute a command, or if a condition specified by "verify" or "assert" command is not met.


Logs can be filtered by type. For example, if you choose to select the "Error" option from the dropdown list, the Log Pane will show error messages only.

Reference Pane

The Reference Pane shows a concise description of the currently selected Selenese command in the Editor. It also shows the description about the locator and value to be used on that command.

UI-Element Pane

The UI-Element is for advanced Selenium users. It uses JavaScript Object Notation (JSON) to define element mappings. The documentation and resources are found in the "UI Element Documentation" option under the Help menu of Selenium IDE.
An example of a UI-element screen is shown below.

Rollup Pane

Rollup allows you to execute a group of commands in one step.A group of commands is simply called as a "rollup." It employs heavy use of JavaScript and UI-Element concepts to formulate a collection of commands that is similar to a "function" in programming languages.
Rollups are reusable; meaning, they can be used multiple times within the test case. Since rollups are groups of commands condensed into one, they contribute a lot in shortening your test script.
An example of how the contents of the rollup tab look like is shown below.


Summary

  • Selenium IDE (Integrated Development Environment) is the simplest tool in the Selenium Suite.
  • It must only be used as a prototyping tool.
  • Knowledge of JavaScript and HTML is required for intermediate topics such as executing the "runScript" and "rollup" commands.A rollup is a collection of commands that you can reuse to shorten your test scripts significantly.Locators are identifiers that tell Selenium IDE how to access an element.
  • Firebug (or any similar add-on) is used to obtain locator values.
  • The menu bar is used in creating, modifying, and exporting test cases into formats useable by Selenium RC and WebDriver.
  • The default format for Selenese commands is HTML.
  • The "Options" menu provides access to various configurations for Selenium IDE.
  • The Base URL is useful in accessing relative URLs.
  • The Test Case Pane shows the list of currently opened test cases and a concise summary of test runs.
  • The Editor provides the interface for your test scripts.
  • The Table View shows your script in tabular format with "Command", "Target", and "Value" as the columns.
  • The Source View shows your script in HTML format.
  • The Log and Reference tabs give feedback and other useful information when executing tests.
  • The UI-Element and Rollup tabs are for advanced Selenium IDE users only. They both require considerable effort in coding JavaScript.
  • UI-Element allows you to conveniently map UI elements using JavaScript Object Notation (JSON).

Creating your First Selenium IDE script

We will use the Mercury Tours website as our web application under test. It is an online flight reservation system that contains all the elements we need for this tutorial. Its URL ishttp://newtours.demoaut.com/ and this will be our Base URL.
NOTE: The site http://newtours.demoaut.com/ at time is down and not available to work on. We have raised this issue with HP

Create a Script by Recording

Let us now create our first test script in Selenium IDE using the most common method - by recording. Afterwards, we shall execute our script using the playback feature.
Step 1
  • Launch Firefox and Selenium IDE.
  • Type the value for our Base URL: http://newtours.demoaut.com/.
  • Toggle the Record button on (if it is not yet toggled on by default).

 
Step 2
In Firefox, navigate to http://newtours.demoaut.com/. Firefox should take you to the page similar to the one shown below.
Step 3
  • Right-click on any blank space within the page, like on the Mercury Tours logo on the upper left corner. This will bring up the Selenium IDE context menu. Note: Do not click on any hyperlinked objects or images
  • Select the "Show Available Commands" option.
  • Then, select "assertTitle exact:Welcome: Mercury Tours". This is a command that makes sure that the page title is correct.
Step 4
  • In the "User Name" text box of Mercury Tours, type an invalid username, "invalidUN".
  • In the "Password" text box, type an invalid password, "invalidPW".
Step 5
  • Click on the "Sign-In" button. Firefox should take you to this page.

Step 6
Toggle the record button off to stop recording. Your script should now look like the one shown below.
Step 7
Now that we are done with our test script, we shall save it in a test case. In the File menu, select "Save Test Case". Alternatively, you can simply press Ctrl+S.
Step 8
  • Choose your desired location, and then name the test case as "Invalid_login".
  • Click the "Save" button.
Step 9.
Notice that the file was saved as HTML.
Step 10.
Go back to Selenium IDE and click the Playback button to execute the whole script. Selenium IDE should be able to replicate everything flawlessly.

Introduction to Selenium Commands - Selenese

  • Selenese commands can have up to a maximum of two parameters: target and value.
  • Parameters are not required all the time. It depends on how many the command will need.
  • For a complete reference of Selenese commands, click here

3 Types of Commands

Actions
These are commands that directly interact with page elements.
Example: the "click" command is an action because you directly interact with the element you are clicking at.
The "type" command is also an action because you are putting values into a text box, and the text box shows them to you in return. There is a two-way interaction between you and the text box.
Accessors
They are commands that allow you to store values to a variable.
Example: the "storeTitle" command is an accessor because it only "reads" the page title and saves it in a variable. It does not interact with any element on the page.
Assertions
They are commands that verify if a certain condition is met.
      3 Types of Assertions
  • Assert. When an "assert" command fails, the test is stopped immediately.
  • Verify. When a "verify" command fails, Selenium IDE logs this failure and continues with the test execution.
  • WaitFor. Before proceeding to the next command, "waitFor" commands will first wait for a certain condition to become true.
    • If the condition becomes true within the waiting period, the step passes.
    • If the condition does not become true, the step fails. Failure is logged, and test execution proceeds to the next command.
    • By default, timeout value is set to 30 seconds. You can change this in the Selenium IDE Options dialog under the General tab.

Assert vs. Verify

Common Commands

Command
Number of Parameters
Description
open
0 - 2
Opens a page using a URL.
click/clickAndWait
1
Clicks on a specified element.
type/typeKeys
2
Types a sequence of characters.
verifyTitle/assertTitle
1
Compares the actual page title with an expected value.
verifyTextPresent
1
Checks if a certain text is found within the page.
verifyElementPresent
1
Checks the presence of a certain element.
verifyTable
2
Compares the contents of a table with expected values.
waitForPageToLoad
1
Pauses execution until the page is loaded completely.
waitForElementPresent
1
Pauses execution until the specified element becomes present.

Create a Script Manually with Firebug

Now, we shall recreate the same test case manually, by typing in the commands. This time, we will need to use Firebug.
Step 1
Step 2
Click on the topmost blank line in the Editor.
Type "open" in the Command text box and press Enter.
Step 3
  • Navigate Firefox to our base URL and activate Firebug
  • In the Selenium IDE Editor pane, select the second line (the line below the "open" command) and create the second command by typing "assertTitle" on the Command box.
  • Feel free to use the autocomplete feature.
Step 4
  • In Firebug, expand the tag to display the tag.</li> <li style="padding: 0px; margin: 0px;">Click on the value of the <title> tag (which is "Welcome: Mercury Tours") and paste it onto the Target field in the Editor.</li> </ul> <p style="margin-bottom: 15px; text-align: center;"> <a class="modal" href="http://cdn.guru99.com/images/Step4manual.png" style="color: rgb(112, 189, 205); text-decoration: none; transition: color 0.2s ease-out; -webkit-transition: color 0.2s ease-out; -webkit-tap-highlight-color: rgba(112, 189, 205, 0.498039); position: relative !important;"><img alt="" src="http://cdn.guru99.com/images/Step4manual.png" style="max-width: 100%; height: auto; vertical-align: middle; border: 0px;"></a></p> </td></tr> <tr><td style="width: 848px;"><strong>Step 5</strong><ul style="padding: 0px; margin: 0px 0px 15px 20px;"> <li style="padding: 0px; margin: 0px;">To create the third command, click on the third blank line in the Editor and key-in "type" on the Command text box.</li> <li style="padding: 0px; margin: 0px;">In Firebug, click on the "Inspect" button.</li> </ul> <p style="margin-bottom: 15px; margin-left: 0.25in; text-align: center;"> <a class="modal" href="http://cdn.guru99.com/images/Step5mnual.png" style="color: rgb(112, 189, 205); text-decoration: none; transition: color 0.2s ease-out; -webkit-transition: color 0.2s ease-out; -webkit-tap-highlight-color: rgba(112, 189, 205, 0.498039); position: relative !important;"><img alt="" src="http://cdn.guru99.com/images/Step5mnual.png" style="max-width: 100%; height: auto; vertical-align: middle; border: 0px;"></a></p> </td></tr> <tr><td style="width: 848px;">Click on the User Name text box. Notice that Firebug automatically shows you the HTML code for that element.<p style="margin-bottom: 15px; margin-left: 0.25in; text-align: center;"> <a class="modal" href="http://cdn.guru99.com/images/ste5manual1.png" style="color: rgb(112, 189, 205); text-decoration: none; transition: color 0.2s ease-out; -webkit-transition: color 0.2s ease-out; -webkit-tap-highlight-color: rgba(112, 189, 205, 0.498039); position: relative !important;"><img alt="" src="http://cdn.guru99.com/images/ste5manual1.png" style="max-width: 100%; height: auto; vertical-align: middle; border: 0px;"></a></p> </td></tr> <tr><td style="width: 848px;"><strong>Step 6</strong><p style="margin-bottom: 15px;"> Notice that the User Name text box does not have an ID, but it has a NAME attribute. We shall, therefore, use its NAME as the locator. Copy the NAME value and paste it onto the Target field in Selenium IDE.</p> <p style="margin-bottom: 15px; margin-left: 0.25in; text-align: center;"> <a class="modal" href="http://cdn.guru99.com/images/step6a.png" style="color: rgb(112, 189, 205); text-decoration: none; transition: color 0.2s ease-out; -webkit-transition: color 0.2s ease-out; -webkit-tap-highlight-color: rgba(112, 189, 205, 0.498039); position: relative !important;"><img alt="" src="http://cdn.guru99.com/images/step6a.png" style="max-width: 100%; height: auto; vertical-align: middle; border: 0px;"></a></p> <p style="margin-bottom: 15px; margin-left: 0.25in;">  </p> <p style="margin-bottom: 15px;"> Still in the Target text box, prefix "userName" with "name=", indicating that Selenium IDE should target an element whose NAME attribute is "userName."</p> <p style="margin-bottom: 15px; margin-left: 0.25in; text-align: center;"> <a class="modal" href="http://cdn.guru99.com/images/step6b.png" style="color: rgb(112, 189, 205); text-decoration: none; transition: color 0.2s ease-out; -webkit-transition: color 0.2s ease-out; -webkit-tap-highlight-color: rgba(112, 189, 205, 0.498039); position: relative !important;"><img alt="" src="http://cdn.guru99.com/images/step6b.png" style="max-width: 100%; height: auto; vertical-align: middle; border: 0px;"></a></p> <p style="margin-bottom: 15px;"> <span class="gmw_">Type "invalidUN" in the Value text box of Selenium IDE. Your test script should now look like the image below. We are done with the third command. Note: Instead of <span class="gm_ gm_7bc983f1-c3a1-29bb-350c-2f2b68a23fec gm-spell">invalidUN</span> , you may enter any other text string. But Selenium IDE is case sensitive and you type values/attributes exactly like in application.</span></p> <p style="margin-bottom: 15px; margin-left: 0.25in; text-align: center;"> <a class="modal" href="http://cdn.guru99.com/images/Step6c.png" style="color: rgb(112, 189, 205); text-decoration: none; transition: color 0.2s ease-out; -webkit-transition: color 0.2s ease-out; -webkit-tap-highlight-color: rgba(112, 189, 205, 0.498039); position: relative !important;"><img alt="" src="http://cdn.guru99.com/images/Step6c.png" style="max-width: 100%; height: auto; vertical-align: middle; border: 0px;"></a></p> <p style="margin-bottom: 15px;">  </p> </td></tr> <tr><td style="width: 848px;"><strong>Step 7</strong><ul style="padding: 0px; margin: 0px 0px 15px 20px;"> <li style="padding: 0px; margin: 0px;">To create the fourth command, key-in "type" on the Command text box.</li> <li style="padding: 0px; margin: 0px;">Again, use Firebug's "Inspect" button to get the locator for the "Password" text box. </li> </ul> <p style="margin-bottom: 15px;">  </p> <h3 style="margin: 10px 0px; font-family: inherit; line-height: 40px; color: inherit; text-rendering: optimizeLegibility; font-size: 25.5px; text-align: center;"> <a class="modal" href="http://cdn.guru99.com/images/firebug_-_step_8.png" style="color: rgb(112, 189, 205); text-decoration: none; transition: color 0.2s ease-out; -webkit-transition: color 0.2s ease-out; -webkit-tap-highlight-color: rgba(112, 189, 205, 0.498039); position: relative !important;"><img alt="" src="http://cdn.guru99.com/images/firebug_-_step_8.png" style="max-width: 100%; height: auto; vertical-align: middle; border: 0px;"></a></h3> <ul style="padding: 0px; margin: 0px 0px 15px 20px;"> <li style="padding: 0px; margin: 0px;"><p style="margin-bottom: 15px;"> <span style="color: rgb(104, 99, 98); font-size: 12px;">Paste the NAME attribute ("password") onto the Target field and prefix it with "name="</span></p> </li> <li style="padding: 0px; margin: 0px;"><p style="margin-bottom: 15px;"> <span style="color: rgb(102, 102, 102); text-align: center;">Type "invalidPW" in the Value field in Selenium IDE. Your test script should now look like the image below.</span></p> </li> </ul> <p style="margin-bottom: 15px; margin-left: 0.25in; text-align: center;"> <a class="modal" href="http://cdn.guru99.com/images/ide_-_step_8.png" style="color: rgb(112, 189, 205); text-decoration: none; transition: color 0.2s ease-out; -webkit-transition: color 0.2s ease-out; -webkit-tap-highlight-color: rgba(112, 189, 205, 0.498039); position: relative !important;"><img alt="" src="http://cdn.guru99.com/images/ide_-_step_8.png" style="max-width: 100%; height: auto; vertical-align: middle; border: 0px;"></a></p> <p style="margin-bottom: 15px; margin-left: 0.25in;">  </p> </td></tr> <tr><td style="width: 848px;"><strong>Step 8</strong><ul style="padding: 0px; margin: 0px 0px 15px 20px;"> <li style="padding: 0px; margin: 0px;">For the fifth command, type "clickAndWait" on the Command text box in Selenium IDE.</li> <li style="padding: 0px; margin: 0px;">Use Firebug's "Inspect" button to get the locator for the "Sign In" button.</li> </ul> <p style="margin-bottom: 15px; margin-left: 0.25in; text-align: center;"> <a class="modal" href="http://cdn.guru99.com/images/firebug_-_step_9.png" style="color: rgb(112, 189, 205); text-decoration: none; transition: color 0.2s ease-out; -webkit-transition: color 0.2s ease-out; -webkit-tap-highlight-color: rgba(112, 189, 205, 0.498039); position: relative !important;"><img alt="" src="http://cdn.guru99.com/images/firebug_-_step_9.png" style="max-width: 100%; height: auto; vertical-align: middle; border: 0px;"></a></p> <ul style="padding: 0px; margin: 0px 0px 15px 20px;"> <li style="padding: 0px; margin: 0px;">Paste the value of the NAME attribute ("login") onto the Target text box and prefix it with "name=".</li> <li style="padding: 0px; margin: 0px;">Your test script should now look like the image below.</li> </ul> <p style="margin-bottom: 15px; margin-left: 0.25in; text-align: center;"> <a class="modal" href="http://cdn.guru99.com/images/Step8a.png" style="color: rgb(112, 189, 205); text-decoration: none; transition: color 0.2s ease-out; -webkit-transition: color 0.2s ease-out; -webkit-tap-highlight-color: rgba(112, 189, 205, 0.498039); position: relative !important;"><img alt="" src="http://cdn.guru99.com/images/Step8a.png" style="max-width: 100%; height: auto; vertical-align: middle; border: 0px;"></a></p> </td></tr> <tr><td style="width: 848px;"><strong>Step 9</strong><p style="margin-bottom: 15px;"> Save the test case in the same way as we did in the previous section.</p> </td></tr> </tbody></table> <div style="color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"> <h2 style="margin: 10px 0px; font-family: 'Droid Sans', Helvetica, arial, serif; line-height: 1.1em; color: inherit; text-rendering: optimizeLegibility; font-size: 30.6000003814697px;"> Using the Find Button</h2> </div> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);">  </p> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"> <strong>The Find button in Selenium IDE is used to verify if what we had put in the Target text box is indeed the correct UI element.</strong></p> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"> Let us use the Invalid_login test case that we created in the previous sections. Click on any command with a Target entry, say, the third command.</p> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; text-align: center; background-color: rgb(255, 255, 255);">  </p> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"> <a class="modal" href="http://cdn.guru99.com/images/find(1).png" style="color: rgb(112, 189, 205); text-decoration: none; transition: color 0.2s ease-out; -webkit-transition: color 0.2s ease-out; -webkit-tap-highlight-color: rgba(112, 189, 205, 0.498039); position: relative !important;"><img alt="" src="http://cdn.guru99.com/images/find(1).png" style="max-width: 100%; height: auto; vertical-align: middle; border: 0px;"></a></p> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);">  </p> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"> Click on the Find button. Notice that the User Name text box within the Mercury Tours page becomes highlighted for a second.</p> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; text-align: center; background-color: rgb(255, 255, 255);">  </p> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"> <a class="modal" href="http://cdn.guru99.com/images/firefox_-_user_name_highlighted(1).png" style="color: rgb(112, 189, 205); text-decoration: none; transition: color 0.2s ease-out; -webkit-transition: color 0.2s ease-out; -webkit-tap-highlight-color: rgba(112, 189, 205, 0.498039); position: relative !important;"><img alt="" src="http://cdn.guru99.com/images/firefox_-_user_name_highlighted(1).png" style="max-width: 100%; height: auto; vertical-align: middle; border: 0px;"></a></p> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"> This indicates that Selenium IDE was able to detect and access the expected element correctly. If the Find button highlighted a different element or no element at all, then there must be something wrong with your script.</p> <div style="color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"> <h2 style="margin: 10px 0px; font-family: 'Droid Sans', Helvetica, arial, serif; line-height: 1.1em; color: inherit; text-rendering: optimizeLegibility; font-size: 30.6000003814697px;"> Execute Command</h2> </div> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);">  </p> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"> <strong>This allows you to execute any single command without running the whole test case</strong>. Just click on the line you wish to execute and then either click on "Actions > Execute this command" from the menu bar or simply press "X" on your keyboard.</p> <table border="0" cellpadding="0" cellspacing="0" style="max-width: 100%; border-collapse: collapse; border-spacing: 0px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"><tbody> <tr><td><p style="margin-bottom: 15px;"> <strong>Step 1. </strong>Make sure that your browser is on the Mercury Tours homepage. Click on the command you wish to execute. In this example, click on the "type | userName | invalidUN" line.</p> <p style="margin-bottom: 15px; text-align: center;"> <a class="modal" href="http://cdn.guru99.com/images/execute1.png" style="color: rgb(112, 189, 205); text-decoration: none; transition: color 0.2s ease-out; -webkit-transition: color 0.2s ease-out; -webkit-tap-highlight-color: rgba(112, 189, 205, 0.498039); position: relative !important;"><img alt="" src="http://cdn.guru99.com/images/execute1.png" style="max-width: 100%; height: auto; vertical-align: middle; border: 0px;"></a></p> </td></tr> <tr><td><p style="margin-bottom: 15px;"> <strong>Step 2. </strong>Press "X" on your keyboard.</p> </td></tr> <tr><td><p style="margin-bottom: 15px;"> <strong>Step 3. </strong>Observe that the text box for username becomes populated with the text "invalidUN"</p> <p style="margin-bottom: 15px; text-align: center;"> <a class="modal" href="http://cdn.guru99.com/images/execute2.png" style="color: rgb(112, 189, 205); text-decoration: none; transition: color 0.2s ease-out; -webkit-transition: color 0.2s ease-out; -webkit-tap-highlight-color: rgba(112, 189, 205, 0.498039); position: relative !important;"><img alt="" src="http://cdn.guru99.com/images/execute2.png" style="max-width: 100%; height: auto; vertical-align: middle; border: 0px;"></a></p> </td></tr> </tbody></table> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"> <strong>Executing commands this way is highly dependent on the page that Firefox is currently displaying</strong>. This means that if you try the example above with the Google homepage displayed instead of Mercury Tours', then your step will fail because there is no text box with a "userName" attribute within Google's homepage.</p> <div style="color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"> <h2 style="margin: 10px 0px; font-family: 'Droid Sans', Helvetica, arial, serif; line-height: 1.1em; color: inherit; text-rendering: optimizeLegibility; font-size: 30.6000003814697px;"> Start point</h2> </div> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);">  </p> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"> <strong>A start point is an indicator that tells Selenium IDE which line the execution will start</strong>. <strong>Its shortcut key is "S".</strong></p> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; text-align: center; background-color: rgb(255, 255, 255);"> <a class="modal" href="http://cdn.guru99.com/images/startpoint.png" style="color: rgb(112, 189, 205); text-decoration: none; transition: color 0.2s ease-out; -webkit-transition: color 0.2s ease-out; -webkit-tap-highlight-color: rgba(112, 189, 205, 0.498039); position: relative !important;"><img alt="" src="http://cdn.guru99.com/images/startpoint.png" style="max-width: 100%; height: auto; vertical-align: middle; border: 0px;"></a></p> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"> <span class="gmw_">In the example above, playback will start on the third line (type | password | <span class="gm_ gm_988b89c6-aa18-f219-49cf-7a593dae56c1 gm-spell">invalidPW</span>). </span><strong>You can only have one start point in a single test script.</strong></p> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"> Start point is similar to Execute Command in such that they are dependent on the currently displayed page. The start point will fail if you are on the wrong page.</p> <div style="color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"> <h2 style="margin: 10px 0px; font-family: 'Droid Sans', Helvetica, arial, serif; line-height: 1.1em; color: inherit; text-rendering: optimizeLegibility; font-size: 30.6000003814697px;"> Breakpoints</h2> </div> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);">  </p> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"> Breakpoints are indicators that tell Selenium IDE where to automatically pause the test. <strong>The shortcut key is "B".</strong></p> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; text-align: center; background-color: rgb(255, 255, 255);"> <a class="modal" href="http://cdn.guru99.com/images/BreakPoint.png" style="color: rgb(112, 189, 205); text-decoration: none; transition: color 0.2s ease-out; -webkit-transition: color 0.2s ease-out; -webkit-tap-highlight-color: rgba(112, 189, 205, 0.498039); position: relative !important;"><img alt="" src="http://cdn.guru99.com/images/BreakPoint.png" style="max-width: 100%; height: auto; vertical-align: middle; border: 0px;"></a></p> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);">  </p> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"> The yellow highlight means that the current step is pending. This proves that Selenium IDE has paused execution on that step. <strong>You can have multiple breakpoints in one test case.</strong></p> <div style="color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"> <h2 style="margin: 10px 0px; font-family: 'Droid Sans', Helvetica, arial, serif; line-height: 1.1em; color: inherit; text-rendering: optimizeLegibility; font-size: 30.6000003814697px;"> Step</h2> </div> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"> It allows you to execute succeeding commands one at a time after pausing the test case. Let us use the scenario in the previous section "Breakpoints."</p> <table border="0" cellpadding="0" cellspacing="0" style="max-width: 100%; border-collapse: collapse; border-spacing: 0px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"><tbody> <tr><td style="width: 367px;"><p style="margin-bottom: 15px; text-align: justify;"> <a class="modal" href="http://cdn.guru99.com/images/Stepa.png" style="color: rgb(112, 189, 205); text-decoration: none; transition: color 0.2s ease-out; -webkit-transition: color 0.2s ease-out; -webkit-tap-highlight-color: rgba(112, 189, 205, 0.498039); position: relative !important;"><img alt="" src="http://cdn.guru99.com/images/Stepa.png" style="max-width: 100%; height: auto; vertical-align: middle; border: 0px;"></a></p> </td><td style="width: 367px;"><p style="margin-bottom: 15px;"> <strong>Before clicking "Step."</strong></p> <p style="margin-bottom: 15px;"> The test case pauses at the line "clickAndWait | login".</p> </td></tr> <tr><td style="width: 367px;"><p style="margin-bottom: 15px;"> <a class="modal" href="http://cdn.guru99.com/images/Stepb.png" style="color: rgb(112, 189, 205); text-decoration: none; transition: color 0.2s ease-out; -webkit-transition: color 0.2s ease-out; -webkit-tap-highlight-color: rgba(112, 189, 205, 0.498039); position: relative !important;"><img alt="" src="http://cdn.guru99.com/images/Stepb.png" style="max-width: 100%; height: auto; vertical-align: middle; border: 0px;"></a></p> </td><td style="width: 367px;"><p style="margin-bottom: 15px;"> <strong>After clicking "Step."</strong></p> <p style="margin-bottom: 15px;"> <span class="gmw_">The "clickAndWait | login" line is run and pauses to the next command (<span class="gm_ gm_fcf6ae63-b0d7-69a9-8193-953b3c9fff33 gm-spell">verifyTitle</span> | Sign-on: Mercury Tours).</span></p> <p style="margin-bottom: 15px;">  </p> <p style="margin-bottom: 15px;"> Notice that the next line is paused even though there is no breakpoint there. This is the main purpose of the Step feature - it executes the succeeding commands one at a time to give you more time to inspect the outcome after each step.</p> </td></tr> </tbody></table> <div style="color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"> <p style="margin-bottom: 15px;">  </p> <h2 style="margin: 10px 0px; font-family: 'Droid Sans', Helvetica, arial, serif; line-height: 1.1em; color: inherit; text-rendering: optimizeLegibility; font-size: 30.6000003814697px;"> Important Things to Note When Using Other Formats in Source View</h2> <p style="margin-bottom: 15px; text-align: center;"> <a class="modal" href="http://cdn.guru99.com/images/Caution.png" style="color: rgb(112, 189, 205); text-decoration: none; transition: color 0.2s ease-out; -webkit-transition: color 0.2s ease-out; -webkit-tap-highlight-color: rgba(112, 189, 205, 0.498039); position: relative !important;"><img alt="" src="http://cdn.guru99.com/images/Caution.png" style="max-width: 100%; height: auto; vertical-align: middle; border: 0px;"></a></p> <p style="margin-bottom: 15px;"> <strong>Selenium IDE works well only with HTML - other formats are still in experimental mode</strong>. It is <strong>NOT advisable</strong> to create or edit tests using other formats in Source View because there is still a lot of work needed to make it stable. Below are the known bugs as of version 1.9.1.</p> <ul style="padding: 0px; margin: 0px 0px 15px 20px;"> <li style="padding: 0px; margin: 0px 0px 0px 0.5in;">You will not be able to perform playback nor switch back to Table View unless you revert to HTML.</li> <li style="padding: 0px; margin: 0px 0px 0px 0.5in;">The only way to add commands safely on the source code is by recording them.</li> <li style="padding: 0px; margin: 0px 0px 0px 0.5in;">When you modify the source code manually, all of it will be lost when you switch to another format.</li> <li style="padding: 0px; margin: 0px 0px 0px 0.5in;">Though you can save your test case while in Source View, Selenium IDE will not be able to open it.</li> </ul> <p style="margin-bottom: 15px;"> <strong>The recommended way to convert <span class="gm_ gm_57833fde-dcf4-2214-0183-b0998308e1fe gm-spell">Selenese</span> tests is to use the "Export Test Case As..." option under the File menu, and not through the Source View.</strong>.</p> <h2 style="margin: 10px 0px; font-family: 'Droid Sans', Helvetica, arial, serif; line-height: 1.1em; color: inherit; text-rendering: optimizeLegibility; font-size: 30.6000003814697px;"> Summary</h2> </div> <ul class="checklist" style="padding: 0px; margin: 0px 0px 15px 20px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);"> <li style="padding: 0px; margin: 0px;">Test scripts can be created either by recording or typing the commands and parameters manually.</li> <li style="padding: 0px; margin: 0px;">When creating scripts manually, Firebug is used to get the locator.</li> <li style="padding: 0px; margin: 0px;">The Find button is used to check that the command is able to access the correct element.</li> <li style="padding: 0px; margin: 0px;">Table View displays a test script in tabular form while Source View displays it in HTML format.</li> <li style="padding: 0px; margin: 0px;">Changing the Source View to a non-HTML format is still experimental.</li> <li style="padding: 0px; margin: 0px;">Do not use the Source View in creating tests in other formats. Use the Export features instead.</li> <li style="padding: 0px; margin: 0px;">Parameters are not required all the time. It depends upon the command.</li> <li style="padding: 0px; margin: 0px;">There are three types of commands:</li> <li style="padding: 0px; margin: 0px 0px 0px 120px;">Actions - directly interacts with page elements</li> <li style="padding: 0px; margin: 0px 0px 0px 120px;">Accessors - "reads" an element property and stores it in a variable</li> <li style="padding: 0px; margin: 0px 0px 0px 120px;">Assertions - compares an actual value with an expected one</li> <li style="padding: 0px; margin: 0px;">Assertions have three types:</li> <li style="padding: 0px; margin: 0px 0px 0px 120px;">Assert - upon failure, succeeding steps are no longer executed</li> <li style="padding: 0px; margin: 0px 0px 0px 120px;">Verify - upon failure, succeeding steps are still executed.</li> <li style="padding: 0px; margin: 0px 0px 0px 120px;">WaitFor - passes if the specified condition becomes true within the timeout period; otherwise, it will fail</li> <li style="padding: 0px; margin: 0px;">The most common commands are:</li> <li style="padding: 0px; margin: 0px 0px 0px 120px;">open</li> <li style="padding: 0px; margin: 0px 0px 0px 120px;">click/clickAndWait</li> <li style="padding: 0px; margin: 0px 0px 0px 120px;">type/typeKeys</li> <li style="padding: 0px; margin: 0px 0px 0px 120px;">verifyTitle/assertTitle</li> <li style="padding: 0px; margin: 0px 0px 0px 120px;"><span class="gm_ gm_53e080f7-9183-850b-f3dd-85f438ad2db4 gm-spell">verifyTextPresent</span></li> <li style="padding: 0px; margin: 0px 0px 0px 120px;"><span class="gm_ gm_19df2b21-1c17-a571-e613-c5b38197c6c4 gm-spell">verifyElementPresent</span></li> <li style="padding: 0px; margin: 0px 0px 0px 120px;"><span class="gm_ gm_15668568-11a4-fd06-9973-a80df0c014db gm-spell">verifyTable</span></li> <li style="padding: 0px; margin: 0px 0px 0px 120px;"><span class="gm_ gm_a505b6a2-e466-843e-a07b-54833af744dd gm-spell">waitForPageToLoad</span></li> <li style="padding: 0px; margin: 0px 0px 0px 120px;"><span class="gm_ gm_9ed024af-2602-a851-580b-b54aa18fb0b8 gm-spell">waitForElementPresent</span></li> </ul> <p style="margin-bottom: 15px; color: rgb(52, 52, 52); font-family: 'Droid Sans'; font-size: 17px; line-height: 24px; background-color: rgb(255, 255, 255);">  </p> <p> <a href="http://qtpdiscussion.blogspot.in/2014/07/home-page.html"></a> </p> <blockquote> </blockquote> </div>