/
//
Using the Selenium IDE, QA Tester can record a test to comprehend the syntax of Selenium IDE commands, or to check the basic syntax for a specific type of user interface. Keep in mind that Selenium IDE recorder is not clever as QA Testers want it to be. Quality assurance team should never consider Selenium IDE as a "record, save, and run it" tool, all the time anticipate reworking a recorded test cases to make them maintainable in the future.
It allows the user to pick from a list of assertions and verifications for the selected location.
Selenium’s recording language is “HTML”.
Check on each page
assertTrue(selenium.isElementPresent(locator));
Selenium IDE has many great features and is a fruitful and well-organized test automation tool for developing test cases, in the same time Selenium IDE is missing certain vital features of a testing tool: conditional statements, loops, logging functionality, exception handling, reporting functionality, database testing, re-execution of failed tests and screenshots taking capability. Selenium IDE doesn't for IE, Safari and Opera browsers.
Selenium IDE is an integrated development environment for Selenium tests. It is implemented as a Firefox extension, and has a recording feature, which will keep account of user actions as they are performed and store them as a reusable script to play back. Selenium-IDE also offers full editing of test cases for more precision and control.
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
It permits user to select from assertions and verifications list for chosen specific location.
Break point can be set in two ways in Selenium IDE
Firefox and IE have browser modes which are not restricted by java script’s same origin policy. These browsers are known as browsers with elevated security privileges. In case of Firefox it is known as chrome (It’s not the Google browser) and in case of IE it is known as iehta
It is the next generation selenium. It is selenium server-web driver that replaces Selenium RC.
Absolute URL: Its is base url and this represent domain address. Relative URL: (Absolute URL + Page Path). Open command uses Base URL (Absolute URL) to navigate web page.
Selenium is open source software, released under the Apache 2.0 license and can be downloaded and used without charge.
Selenium-Grid allows the Selenium-RC solution to scale for test suites or test suites to be run in multiple environments.
With Selenium-Grid multiple instances of Selenium-RC are running on various operating system and browser configurations, each of these when launching register with a hub. When tests are sent to the hub they are then redirected to an available Selenium-RC, which will launch the browser and run the test.
This allows for running tests in parallel, with the entire test suite theoretically taking only as long to run as the longest individual test.
You may like to create your own firefox profile because Selenium always created a clean firefox profile while executing the tests and none of your FF settings and plug-in are considered with this clean profile. If you want to execute tests on FF with your settings then you should create custom profile for FF.
To be able to execute tests on a custom firefox profile you should specify its path while starting Selenium server. For example if your new profile is stored at “awesome location” in your directory then you should start Selenium server as following–
Java –jar .jar -firefoxProfileTemplate "awesome location"
Selenium IDE. It was a very tricky interview question.
Selenium remote control is used in this case.
If you want to see all options available while starting Selenium server then you should use option “-h” while starting Selenium server
Java –jar .jar –h
It would display you all the options which you can use while starting the Selenium server.
First select and choose interested value from drop-down.
Advantages
Disadvantages
Ajax interview questions could be tough for newbie in the test automation, but will be easily cracked by Selenium Tester with a relevant experience. Read the detailed approach at Testing Ajax applications with Selenium in the right way
If you are using Firefox then you can use “type” command to type in a File Input box of upload file. But type operation does not work with IE and you would have to use “Robot” class in java to work make file upload work.
C#, Java, Perl, PHP, Python, Ruby
The web applications may be written in Java, Ruby, PHP, Python or any other web framework. There are certain advantages for using the same language for writing test cases as application under test. For example, if the team already have the experience with Java, QA Tester could always get the piece of advice while mastering Selenium test cases in Java. Sometimes it is better to choose simple programming language that will ultimately deliver better success. In this case QA testers can adopt easier programming languages, for example Ruby, much faster comparing with Java, and can become become experts as soon as possible.
Selenium appears to be the mainstream open source tool for browser side testing, but there are many alternatives. Canoo Webtest is a great Selenium alternative and it is probably the fastest automation tool. Another Selenium alternative is Watir, but in order to use Watir QA Tester has to learn Ruby. One more alternative to Selenium is Sahi, but is has confusing interface and small developers community.
provide a time to check the element( in seconds) Like :
public void waitForElementPresent(String element, int timeout) throws Exception { for (int second = 0;; second++) { if (second >= timeout) fail("Timeout.Unable to find the Specified element"+element); try { if (selenium.isElementPresent(element)) break; } catch (Exception e) { } Thread.sleep(1000); } }
Selenium WebDriver is a tool for writing automated tests of websites. It is an API name and aims to mimic the behaviour of a real user, and as such interacts with the HTML of the application. Selenium WebDriver is the successor of Selenium Remote Control which has been officially deprecated.
Play Entire Test Suite
As with any other type of test automation tools like SilkTest, HP QTP, Watir, Canoo Webtest, Selenium allows to record, edit, and debug tests cases. However there are several problems that seriously affect maintainability of recorded test cases, occasionally Quality Assurance Engineers complain that it takes more time to maintain automated test cases than to perform manual testing; however this is an issue with all automated testing tools and most likely related to improper testing framework design. Another problem is complex ID for an HTML element. If IDs is auto-generated, the recorder test cases may fail during playback. The work around is to use XPath to find required HTML element. Selenium supports AJAX without problems, but QA Tester should be aware that Selenium does not know when AJAX action is completed, so ClickAndWait will not work. Instead QA tester could use pause, but the snowballing effect of several 'pause' commands would really slow down total testing time of test cases. The best solution would be to use waitForElement.
click, clickandWait, ClickAt, ClickAtandWait, DoubleClick, DoubleClickandWait, doubleClickAt,
doubleClickAtandWait
Ajax operations don’t reload a page like normal form submission but they make http requests behind the scene. You cannot use waitForPageToLoad for such operations and instead should use conditional wait for change in state of application. This could as well mean waiting for presence of an element before continuing with test operations. Consider following example in which type operation triggers Ajax operation which is followed by conditional wait for presence of a text box
selenium.type("elementLocator","testData"); // conditional wait for element “q” for(intsecond = 0;; second++) { if(second >= 60) fail("timeout"); try {if(selenium.isElementPresent("q"))break;}catch(Exception e){} Thread.sleep(1000); }
Advantages: Free, Simple and powerful DOM (document object model) level testing, can be used for continuous integration; great fit with Agile projects.
Disadvantages: Tricky setup; dreary errors diagnosis; can not test client server applications.
Selenium could be used for the functional, regression, load testing of the web based applications. The automation tool could be implemented for post release validation with continuous integration tools like Jenkins, Hudson, QuickBuild or CruiseControl.
Comments in Selenium IDE can be set in two ways
<tr> <!-- <td>open&l/td> <td>/node/304/edit&l/td> <td></td> --> </tr>
The very basic steps are:
Selenium is open source software, released under the Apache 2.0 license and can be downloaded and used without charge.
Don't be surprised if the interviewer asks you to describe the approach for learning Selenium. This interviewer wants to hear how you can innovative software test automation process the company. Most likely they are looking for software professional with a good Selenium experience, who can do Selenium training for team members and get the team started with test automation. I hope this Selenium tutorial will be helpful in the preparation for this Selenium interview question.
Selenium IDE supports only one browser Mozilla Firefox. The versions supported as of now are:
Mozilla Firefox 2.x
Mozilla Firefox 3.x
The versions not supported as of now are:
earlier versions of Mozilla Firefox 2.x
Mozilla Firefox 4.x
Selenium-RC provides an API (Application Programming Interface) and library for each of its supported languages: HTML, Java, C#, Perl, PHP, Python, and Ruby. Selenium-RC allows the test automation developer to use a programming language for maximum flexibility and extensibility in developing test logic.
For instance, if the application under test returns a result set, and if the automated test program needs to run tests on each element in the result set, the programming languages iteration support can be used to iterate through the result set, calling Selenium commands to run tests on each item.
This is because IE expects attribute values to be in caps while other browsers expect it to be lower case letters. Hence
//tr[@style="background-color:yellow"] works with other browsers
//tr[@style="BACKGROUND-COLOUR:yellow"] works with IE
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: