div.menu4 { /*width:500px;margin:0 auto;*//*Uncomment this line to make the menu center-aligned.*/ text-align:center; font-size:0; height: 25px; *position:relative;*top:1px;/*Hacks for IE6 & IE7 */ } div.menu4 a { display: inline-block; margin-right:6px; /* It specifies the distance between each tab */ background:#FFF url(bg.gif) repeat-x 0 0; padding-left:4px; vertical-align:top;/*ChangeSet#1*/ text-decoration:none; } div.menu4 a span { display: inline-block; background:#FFF url(bg.gif) repeat-x 100% 0; padding: 0 20px; text-decoration:none; font: normal 12px Arial; line-height: 25px; color:#7087A9; vertical-align:top; } div.menu4 a:hover, div.menu4 a.current { background:#FFF url(bg.gif) repeat-x 0 -25px; line-height: 26px; } div.menu4 a:hover span, div.menu4 a.current span { background:#FFF url(bg.gif) repeat-x 100% -25px; line-height: 26px; color:#244D8A; } div.menu4sub { height:8px; border:1px solid #C2D5EF; background:#eee url(bg.gif) repeat-x 0 -50px; }

Monday, 7 March 2016

Introduction to Selenium IDE

What is Selenium IDE ?
Listed below are the four Selenium Automation tools :
1) Selenium IDE
2) Selenium RC
3) Selenium WebDriver
4) Selenium Grid
Selenium IDE is a firefox extension which will be used to record the tests like recording a movie and playback the recorded evaluations like enjoying a movie.Using Selenium IDE we can produce Selenium Automation Code without writing the code instead the code gets generated automatically when we report the evaluations using Selenium IDE.

Where as with Selenium RC and Selenium WebDriver applications we have to write the code ourselves.We use Selenium RC and Selenium WebDriver to write automation scripts for complex tasks where as Selenium IDE can exclusively be utilized to automate simple endeavors.
Can we dismiss Selenium IDE as we can automate all our evaluations using Selenium 1 and Selenium 2 ?
No, it's impossible to ignore Selenium IDE. It's the only selenium tool which has record and playback feature. Selenium 1 and Selenium 2 don't have this attribute. We could use Selenium IDE to automate simple job.

Why to record and playback ?You will find two reasons to record and play back.
Reason#1 - so as to automate simple scripts, the examiner may not require Selenium 1 and Selenium 2 tools, therefore examiner will simply record and playback using Selenium IDE.
Reason# 2 - While automating tests using Selenium 1 or Selenium 2, the tester may face difficulties while writing the automation scripts. In cases like this the tester will record and play back the test using the Selenium IDE tool and see the automation code generated by the device. He or she will examine his Selenium 1 or Selenium 2 self written code with Selenium IDE's automobile generated code, and make crucial changes to his Selenium Training1 or Selenium Training2 code in order to make it work.
Edges of Selenium IDE:
Simple for novices i.e. Needs less or no computer software development takes quite less time to automate. A superb way of learning Selenium Tutorial Script Syntax in your desirable programming language.
Minuses of Selenium IDE:
Not ideal for complex programs - Reason - If something say Application URL gets changed, we have to record each of the tests from the beginning. Where as in Selenium RC and Selenium WebDriver, we could change it from just one place such that the URL gets upgraded in most of the test automation scripts. So we can't maintain the scripts generated using Selenium IDE.
Repetition of the code - Reason - Lets say there are two evaluations. Test1 -">> Log In to Gmail, View Unread E-Mails and Logout. Test2 -">> Log-In to Gmail, Send Email and Logout. When we use Selenium IDE to record these tests it will create automation code for separate Login and Logout activities. So code is duplicated.

Where as in Selenium RC and Selenium WebDriver we can create automation code for Login & Logout actions and move them to Procedures/Functions. So Test1 will-call Login and Logout functions and also Test2 will call the same Login and Log Out functions. Hence code is just not repeated.
Code is not readable as it features Hard coded values - Reason - Selenium IDE records what ever what the Person performs while recording a test, thus the code contains Hard coded values. Lets say the User has recorded the Test -">> Log-In to Gmail with User Name - arunmotoori and Password - selenium143 using Selenium IDE.

When you browse the code which is automatically created by the Selenium IDE, it will feature the hard-coded values arunmotoori and selenium143. By reading the code we dont understand what arunmotoori and selenium Training. Were as in Selenium RC and Selenium WebDriver we can Parameterise these hard-coded values by replacing them with a valid variant names like Username and Password. Hence the code becomes readable.
Cannot produce constants - There aren't many constants like Program URL, User Names etc. Since the recorded code includes Hard Coded values, whenever some performance gets shifted say Application URL, we have to read all the recorded tests and make changes to all the tests including Hard coded Application URL.

But where-as in Selenium RC and Selenium WebDriver we can parameterise the hard coded values with readable variable names say Applicaition_URL in this event. These variants will be preserved as constants in an alternate spot. When the program URL adjustments in this case, we just update the saved persistent with new URL just once, thus no need to reading the code of all of the tests.
Data Driven evaluations usually are not possible - Suppose should you would like to run the exact same Evaluation say -">> Log-In to Gmail with say 100 different Customers. Using Selenium IDE you must record 100 tests (each test for every single User).

Instead in case you use Selenium RC or Selenium WebDriver you can make single test by parenthesizing the Consumer particulars in the evaluation. Thus it is possible to pass 100 User Names to precisely the same variable and run precisely the same test 100 occasions.
Hence Framework enactment is not potential - Automation Framework is a set of guidelines like 'Code re usability, 'Parametrization' etc. Therefore Framework implementation is not possible with Selenium IDE. It is possible with Selenium RC and Selenium WebDriver.

Validating elements using Selenium IDE
Going forward I'm-not going to describe Selenium IDE in depth as it is not required for just about any examiner to learn it completely. The subjects that I am going to describe in the upcoming posts will likely be sufficient for learning Selenium IDE.

Rather we are able to concentrate much on Selenium 2 which requires thorough knowledge. But without understanding the basic principles of Selenium IDE we cant go forward, as Selenium IDE basics are extremely very important to learn:

There are two mechanism for validating elements which are about the application under evaluation using Selenium IDE. In order to know what actually the validation means, please go through the below examples first:
Instances of Validations:
Example1: To check if the UI element exists or not on the Application. If the automation tool finds that the element is available on the application it results MOVE else it will result FAIL as output signal. (Moving forward I'm going to perform this kind of validations using Selenium IDE)
Example2: To check whether the concealed UI component is actually concealed. In the event the automation device finds this component is not concealed it results neglect else it'll result MOVE.
Two mechanism for validating components in Selenium IDE:
Maintain - This allows the test to check on if the component is really on the webpage. If it is unavailable then the test will cease on the step that failed and wont do the remaining measures.
Verify - This allows the test to check whether the component is to the page. If it is not available then the evaluation will fail the measure and carry on execution of the remaining measures.

No comments:

Post a Comment