The command used for displaying the values of a variable into the output console or log – echo
If you want to display a constant string.
The below mentioned command can be used
echo <constant string>
ex: echo “The sample message”
If you want to display the value of a variable it can be written like below
echo ${<variable name>>
ex: echo ${var1}
Note: Here var1 is the variable
The languages supported by Selenium RC:
Selenium supports Opera. And opera is used in most of the Smart phones. So whichever Smart phone supports opera, selenium can be used to test. So, one can use Selenium RC to run the tests on mobiles.
Selenium Assertions can be used in 3 modes:
Start point Selenium IDE can be set in two ways:
Break point can be set in two ways in Selenium IDE
It has Record and Playback features to create and execute Test cases
Selenium IDE supports only one browser Mozilla Firefox.
The versions supported as of now are:
The versions not supported as of now are:
Selenium is a suite of tools for web automation testing. Selenium first came to life in 2004 when Jason Huggins was testing an internal application at Thought Works. Selenium was a tremendous tool, it wasn’t without its drawbacks. Because of its JavaScript based automation engine and the security limitations browsers apply to JavaScript, different things became impossible to do.
Selenium Suite of projects includes:
Check points or verification points are known as Assertions in Selenium. The keywords with below mentioned prefix will be used for adding check points or verification points.
One should use WebDriver when requiring improved support for
Use "store" command
Selenium IDE (Integrated Development Environment) works similar to commercial tools like QTP, Silk Test and Test Partner etc.
The below mentioned points describes well about Selenium IDE:
Yes, we can edit recorded Test cases, Add Steps, Delete steps, edit steps and Insert comments.
Comments in Selenium IDE can be set in two ways:
<tr>
<!–
<td>open&l/td>
<td>/node/304/edit&l/td>
<td></td>
–>
</tr>
Important Commands are:
Open, click, type, select, assertText, assertTitle, assertTextPresent, verifyText, verifyTextPresent, veriftTitle, waitForText, waitForTextPresent, waitForTitle, store, storeText, storeTitle, check, uncheck, pause, mouseover, etc...
Note: After reopen, Selenium IDE may show compilations errors if the user-extensions.js file has any syntax errors.
Single line command from Selenium IDE can be executed in two ways:
In the Selenium IDE options, check "Record Absolute URL" option.
In the browser, the test name in Selenium IDE will be displayed.
Regular expressions in Selenium IDE can be used with the keyword – regexp: as a prefix to the value and patterns needs to be included for the expected values.
For example if you want to use the regular expression for a command
Command: verifyText
Target: //font/font/b/font[1]
Value: Flight Confirmation # 2011-05-02451
in the above example Flight Confirmation is continuously changing each time you run the test case. So this can be written with a regular expression as mentioned below
Command: verifyText
Target: //font/font/b/font[1]
Value: regexp:Flight Confirmation # [0-9]{4}-[0-9]{2}-[0-9]{5,10}
Selenium Grid is part of Selenium suite of projects. Selenium Grid transparently distribute your tests on multiple machines so that you can run your tests in parallel, cutting down the time required for running in-browser test suites. This will dramatically speeds up in-browser web testing, giving you quick and accurate feedback you can rely on to improve your web application.
Selenium-IDE does not directly support:
The Selenium Server which launches and kills browsers, and acts as an HTTP proxy for browser requests.
Client libraries for various programming languages, each of which instructs the Selenium Server in how to test the AUT by passing it your test script’s Selenium commands.
The diagram shows the client libraries communicate with the Server passing each Selenium command for execution. Then the server passes the Selenium command to the browser using Selenium-Core JavaScript commands. The browser, using its JavaScript interpreter, executes the Selenium command, which effectively, runs the check you specified in your Selenese test script.
Selenium IDE
Works in Firefox 2+ Start browser, run tests Run tests
Operating Systems Supported:
Selenium Remote Control
Used for starting browser and run tests
Operating Systems Supported:
Selenium Core
Used for running tests
Operating Systems Supported:
${variableName}
From selenium IDE the test suites can be exported into the languages as mentioned below
The below mentioned steps can explain how to export the test suites:
captureEntirePageScreenshot : Saves the entire contents of the current window canvas to a PNG file. Contrast this with the captureScreenshot command, which captures the contents of the OS viewport (i.e. whatever is currently being displayed on the monitor), and is implemented in the RC only. Currently this only works in Firefox when running in chrome mode, and in IE non-HTA using the EXPERIMENTAL “Snapsie” utility. The Firefox implementation is mostly borrowed from the Screengrab! Firefox extension.
captureEntirePageScreenshotAndWait : Saves the entire contents of the current window canvas to a PNG file. Contrast this with the captureScreenshot command, which captures the contents of the OS viewport (i.e. whatever is currently being displayed on the monitor), and is implemented in the RC only. Currently this only works in Firefox when running in chrome mode, and in IE non-HTA using the EXPERIMENTAL “Snapsie” utility. The Firefox implementation is mostly borrowed from the Screengrab! Firefox extension.
Note: This command runs with only mozilla firefox when you run the tests from RC. Other browsers it will not support
Users can use "Play current test case" function of Selenium IDE
Selenium IDE is firefox ad on, so it runs on Firefox browser.
Selenium set of commands which are used for running the test are called as Selenese.
There are three types of Selenese, those are:
Selenium regular expression patterns offer the same wide array of special characters that exist in JavaScript.
Below are a subset of those special characters:
.: any single character
[ ]character class: any single character that appears inside the brackets
*quantifier: 0 or more of the preceding character (or group)
+quantifier: 1 or more of the preceding character (or group)
?quantifier: 0 or 1 of the preceding character (or group)
{1,5}quantifier: 1 through 5 of the preceding character (or group)
|alternation: the character/group on the left or the character/group on the right
( )grouping: often used with alternation and/or quantifier
Bitmaps are captured using the Selenium set of commands. There are two modes of capturing the bitmaps
Selenium doesn’t support bitmap capturing for an element on AUT.
From selenium IDE the test cases can be exported into the languages
The below mentioned steps can explain how to export the test cases:
WebDriver uses a different underlying framework from Selenium’s javascript Selenium-Core. It also provides an alternative API with functionality not supported in Selenium-RC. WebDriver does not depend on a javascript core embedded within the browser, therefore it is able to avoid some long-running Selenium limitations.
WebDriver’s goal is to provide an API that establishes:
The Selenium developers strive to continuously improve Selenium. Integrating WebDriver is another step in that process. The developers of Selenium and of WebDriver felt they could make significant gains for the Open Source test automation community be combining forces and merging their ideas and technologies. Integrating WebDriver into Selenium is the current result of those efforts.
To debug or execute the test cases line by line.
Follow the below mentioned steps:
Accessors are mostly used for storing the value in a variable.
The variable can be used for following reasons:
Selenium-IDE does not directly support:
The reason behind why Selenium-IDE does not support the above mentioned requirements is IDE supports only HTML language. Using HTML language we cannot achieve the above mentioned requirements. Because HTML does not support conditional, looping and external source connectives.
To overcome the above mentioned problems Selenium RC is used.
Since Selenium RC supports the languages .Net, Java, Perl, Python, PHP, and Ruby. In these languages we can write the programme to achieve the IDE issues
captureEntirePageScreenshot :
CaptureScreenShot :
* symbol means any character
Selenium could be used for testing the web based applications.
The test types can be supported are:
The automation tool could be implemented for post release validation with continuous integration tools like:
There are three types of patterns available in Selenium:
The limitations of Selenium IDE are:
To eliminate the above issues we use Selenium RC
That triangle indicates that test paused at that step, or will start from that step.
Absolute URL means the URL starts with http or https. Selenium IDE addes the argument in the open statement and create an absolute URL
Relative URL means that in BaseURL, we can put the main domain, and in the open statment, user should put relative URL;
For example, if main url is http://mysite.com, in the relative url, we can put http://beta.mysite.com in the open statement.
We need to set a break point in the test, so the test will pause at the break point.
Supported browsers for Selenium RC include: