tag:blogger.com,1999:blog-24835937641829603232024-02-07T00:21:11.163-08:00SeleniumOne (QAFox.com)Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.comBlogger164125tag:blogger.com,1999:blog-2483593764182960323.post-34390096442699952142013-06-23T01:53:00.002-07:002013-06-23T22:05:46.512-07:00122. Using isEditable( ) command to verify whether the Text Box field is enabled or disabled<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpZ97Ws0X9j3jRst7UiU3gP6ENlvnrVG76jyr3U_CqUJo95mymfaTbIKBG8gEcHbbtGlury7aLWxIHTrr63TVDoKcV2JvIEkMT1vgehaM3aLYKt_hVZmhIzPQTzfMQQlrbrZhZRCAfEBLo/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpZ97Ws0X9j3jRst7UiU3gP6ENlvnrVG76jyr3U_CqUJo95mymfaTbIKBG8gEcHbbtGlury7aLWxIHTrr63TVDoKcV2JvIEkMT1vgehaM3aLYKt_hVZmhIzPQTzfMQQlrbrZhZRCAfEBLo/s1600/PreviousPost2.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">As explained in the previous post,<b style="color: #cc0000;"> isEditable( )</b></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> is the predefined method of Selenium RC, which is used to verify whether the specified form element is either enabled or disabled.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">isEditable( )</span></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> method will return true if the specified form element is enabled else it will return false.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Test Description:</b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Please go through the comments on the below screenshot to understand the Test Description</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkIFS4gHK1yEYPFBksG7TFWGHdxeDlFEKCbwOHRdXVdPe1N7jSlVO8Rq0I0BMkTpTCEMhZ4yKBxy9F-cyEPjf_zDTqjQAiHuv2DJDSJOjgT_kV6AAD4aSaq5e73PpEIsPSWQGjKWk-NUPn/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkIFS4gHK1yEYPFBksG7TFWGHdxeDlFEKCbwOHRdXVdPe1N7jSlVO8Rq0I0BMkTpTCEMhZ4yKBxy9F-cyEPjf_zDTqjQAiHuv2DJDSJOjgT_kV6AAD4aSaq5e73PpEIsPSWQGjKWk-NUPn/s1600/1.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Lets Implement the Test on Eclipse IDE:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Pre-requisites:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Create a new Project say 'RC-Project69' in Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Configure the Project to work with Selenium RC</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. Configure the Selenium Standalone Server to run from Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Create a package say 'package69' under the newly created project.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Create a Java Class file say 'Class69' under the newly created package as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6fMkyo0ANW4FIvMe1w6slUwmkOZjXnAs4gGrNwvMoT82_wYM-BI3GGVlmH_mc3pWp_c4pAfIPIJHxtRzUCTiiApwK9mHoJeRqYHIWpQiKAgQHXCgx4oEWFjxzdsv6Of-2_HoUaKkhSU2q/s1600/2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6fMkyo0ANW4FIvMe1w6slUwmkOZjXnAs4gGrNwvMoT82_wYM-BI3GGVlmH_mc3pWp_c4pAfIPIJHxtRzUCTiiApwK9mHoJeRqYHIWpQiKAgQHXCgx4oEWFjxzdsv6Of-2_HoUaKkhSU2q/s1600/2.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Actual Steps:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Write the following code into the newly created Java Class file as shown below and make sure that you resolve all the errors before going to next step:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_J_iwjhyphenhyphenFo3enr3nDpgbBBTBvlJ4aTVEHgpaU_UcwfBcCGKoKQ06kqVjJsZod6XYnpZJg_yjWH5yQXpnOkWhZJA3Wlp9Jkv-rY12iqFFO4tKZhKVY5DidDRRv1Tchs831GiEnYlhGrbg4/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_J_iwjhyphenhyphenFo3enr3nDpgbBBTBvlJ4aTVEHgpaU_UcwfBcCGKoKQ06kqVjJsZod6XYnpZJg_yjWH5yQXpnOkWhZJA3Wlp9Jkv-rY12iqFFO4tKZhKVY5DidDRRv1Tchs831GiEnYlhGrbg4/s1600/3.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Write the test method 'isEditableMethodDemo()' which uses CSS Path Statements for locating the Text Box field and Text Area field as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhD6ln4xdoocdfpxbVzB-CWJuUByL0IpHzyaOyVw94nxGfVOQuaRg9dsewgzvU7P3NV1xs4CIJWpJlpadmlllZnGtXYREnAoRSU6QIrLXrof_rcGyEJTW90rdsYbgeuRADMHzDFvIRN4Jrt/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhD6ln4xdoocdfpxbVzB-CWJuUByL0IpHzyaOyVw94nxGfVOQuaRg9dsewgzvU7P3NV1xs4CIJWpJlpadmlllZnGtXYREnAoRSU6QIrLXrof_rcGyEJTW90rdsYbgeuRADMHzDFvIRN4Jrt/s1600/4.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. Start the Selenium Standalone Server</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Save and Run the 'Class69.java' file by selecting the 'JUnit Test' option and observe that our Automation code has verified whether the specified Text Box field is either enabled or disabled and typed the verification result into the Text Area field as shown in the below video:</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Watch the below video:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<i style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><a href="http://www.youtube.com/watch?v=hSvFIt0iiF8" target="_blank">Click here</a></b></i><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to watch the video.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Download this Project:</span></b><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFQ3ubkmtpiVh9v97qwmRH6Uwyj3F52qlsd57w2zg5S3YCzP80tNIRcOEpTGGcGmDn_GxCbH-PQ_mrVAi28JEA8KeWTLXwUWio3oYD08uNbCVFFHikpnHz2aHPGqJlUq9HWRzZhOhEO0_C/s1600/next5.jpg" imageanchor="1" style="background-color: white; clear: right; color: #771100; float: right; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; margin-left: 1em; text-align: center; text-decoration: none;"><br /></a><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i><a href="http://www.mediafire.com/download/8l6dryl7028z7ff/RC-Project69.zip" target="_blank">Click here</a></i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to download this project and import into Eclipse IDE on your machine.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br />
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<b><span style="color: #cc0000;"><br /></span></b><b style="color: #38761d;"><i><u>Using select command to select a list item from the drop down field</u></i></b><span style="color: #38761d;"><b><i><span style="color: #333333;"> </span></i><span style="color: #333333;"> will be explained in the next post.</span></b></span><br />
<div>
<span style="color: #38761d;"><b><br /></b></span></div>
</div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> </span><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmt-J8dMfMdXLY142Aw8rsq-XFaQL_uB1Ga2AesJeiiJfyzIeiWeYRyd-UIx46EeidaSdw0fXrYolPGn4uk8dQJjugiasqcYm-uV9Kdxuhtd8I-9mAEVtGPQ3HHs-4sWmAONSZ4zoxUQJM/s1600/next5.jpg" imageanchor="1" style="clear: right; color: #cc4411; float: right; margin-bottom: 1em; margin-left: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmt-J8dMfMdXLY142Aw8rsq-XFaQL_uB1Ga2AesJeiiJfyzIeiWeYRyd-UIx46EeidaSdw0fXrYolPGn4uk8dQJjugiasqcYm-uV9Kdxuhtd8I-9mAEVtGPQ3HHs-4sWmAONSZ4zoxUQJM/s1600/next5.jpg" style="border: none; position: relative;" /></a></div>
Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com2tag:blogger.com,1999:blog-2483593764182960323.post-47156222888813187382013-06-21T06:25:00.000-07:002013-06-23T03:09:18.829-07:00122. Using isEditable( ) to find out whether a button is in enabled state or disabled state<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEjoZNYM5_5HmD8mbesgn4ckM53E2occIZIihX0p77o8rOfHPPbWvdXh_PladwxWYAMoF1wu28vTgfgazztxIyYBmKMODvBM8IGeR_EjGxSWCv0a_qqgy1_bbHQyV6Y5uXtM_RtKq-F2Ti/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEjoZNYM5_5HmD8mbesgn4ckM53E2occIZIihX0p77o8rOfHPPbWvdXh_PladwxWYAMoF1wu28vTgfgazztxIyYBmKMODvBM8IGeR_EjGxSWCv0a_qqgy1_bbHQyV6Y5uXtM_RtKq-F2Ti/s1600/PreviousPost2.jpg" /></a></div>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">isEditable( )</span></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> is the predefined method of Selenium RC, which is used to verify whether the specified form element is either enabled or disabled.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">isEditable( )</span></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> method will return true if the specified form element is enabled else it will return false.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Test Description:</b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Please go through the comments on the below screenshot to understand the Test Description</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4HWCXBrSMP_vYNn37nVx3UDhgqXjwybBzd7aF4XiAwIYM76ASC_MwDWOHE2MWr4LUuYQ2ntzRa1fhjxrFX19f4UtSmRmfQiqoGDf2LxIBPXMSPfnJMPgWijlvIkJi8-v74AddpOSahfKO/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4HWCXBrSMP_vYNn37nVx3UDhgqXjwybBzd7aF4XiAwIYM76ASC_MwDWOHE2MWr4LUuYQ2ntzRa1fhjxrFX19f4UtSmRmfQiqoGDf2LxIBPXMSPfnJMPgWijlvIkJi8-v74AddpOSahfKO/s1600/1.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Lets Implement the Test on Eclipse IDE:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Pre-requisites:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Create a new Project say 'RC-Project68' in Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Configure the Project to work with Selenium RC</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. Configure the Selenium Standalone Server to run from Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Create a package say 'package68' under the newly created project.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Create a Java Class file say 'Class68' under the newly created package as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPdYEbYGBVEWZOTh5OEwJZt-FAS0KzCcF2MoSnbGEmeKEYnGRhPtpy6XWpdwKdHBTH3kvcn2g1cNaxaMuzxFHJ22pPSiOjpgrJ5XCAZDwXYXOQAcU-qQbHOJACpUXgYTrk8ie-Zk1HrYkh/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPdYEbYGBVEWZOTh5OEwJZt-FAS0KzCcF2MoSnbGEmeKEYnGRhPtpy6XWpdwKdHBTH3kvcn2g1cNaxaMuzxFHJ22pPSiOjpgrJ5XCAZDwXYXOQAcU-qQbHOJACpUXgYTrk8ie-Zk1HrYkh/s1600/2.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Actual Steps:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Write the following code into the newly created Java Class file as shown below and make sure that you resolve all the errors before going to next step:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCLHXYamO83ZiapxdJJKTrSojJhQlOJQkl3WWjqYBDpuxORkux-rtz9qfjhkP4C31M964gL2p38zWI09Bnwv_E-eEIzosHy11AZyeWMQZVYGfne52rsLssNvt2m0FH2QrBEHz8BFSzP_l-/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCLHXYamO83ZiapxdJJKTrSojJhQlOJQkl3WWjqYBDpuxORkux-rtz9qfjhkP4C31M964gL2p38zWI09Bnwv_E-eEIzosHy11AZyeWMQZVYGfne52rsLssNvt2m0FH2QrBEHz8BFSzP_l-/s1600/3.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Write the test method 'isEditableMethodDemo()' which uses CSS Path Statements for locating the buttons and Text Area field as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoN9Hej0dHGMGzCP5YQgrWreiXRt5NXrn0QnKb6eVQlOOPP3hH1PMdTKQq6sFfa138ah3SeouaEFRUrGcRJxUA6dIpuiBo-PRqwSZd2yUJ-FZ-QmzwU6a2ui0yI_38AHqc-oIMzIleUZy7/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoN9Hej0dHGMGzCP5YQgrWreiXRt5NXrn0QnKb6eVQlOOPP3hH1PMdTKQq6sFfa138ah3SeouaEFRUrGcRJxUA6dIpuiBo-PRqwSZd2yUJ-FZ-QmzwU6a2ui0yI_38AHqc-oIMzIleUZy7/s1600/4.jpg" /></a></div>
<br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. Start the Selenium Standalone Server</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Save and Run the 'Class68.java' file by selecting the 'JUnit Test' option and observe that our Automation code has verified whether the specified buttons Button1 and Button2 are either enabled or disabled and typed the verification results into the Text Area field as shown in the below video:</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Watch the below video:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<i style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><a href="http://www.youtube.com/watch?v=afJEfTnwKos&feature=youtu.be" target="_blank">Click here</a></b></i><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to watch the video.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Download this Project:</span></b><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFQ3ubkmtpiVh9v97qwmRH6Uwyj3F52qlsd57w2zg5S3YCzP80tNIRcOEpTGGcGmDn_GxCbH-PQ_mrVAi28JEA8KeWTLXwUWio3oYD08uNbCVFFHikpnHz2aHPGqJlUq9HWRzZhOhEO0_C/s1600/next5.jpg" imageanchor="1" style="background-color: white; clear: right; color: #771100; float: right; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; margin-left: 1em; text-align: center; text-decoration: none;"><br /></a><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i><a href="http://www.mediafire.com/download/yncgouar7luyk1n/RC-Project68.zip" target="_blank">Click here</a></i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to download this project and import into Eclipse IDE on your machine.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br />
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<b><span style="color: #cc0000;"><br /></span></b><span style="color: #38761d;"><b><i><u>Using isEditable( ) command to verify whether the Text Box field is enabled or disabled</u><span style="color: #333333;"> </span></i><span style="color: #333333;"> will be explained in the next post.</span></b></span><br />
<div>
<span style="color: #38761d;"><b><br /></b></span></div>
</div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span>
<br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmt-J8dMfMdXLY142Aw8rsq-XFaQL_uB1Ga2AesJeiiJfyzIeiWeYRyd-UIx46EeidaSdw0fXrYolPGn4uk8dQJjugiasqcYm-uV9Kdxuhtd8I-9mAEVtGPQ3HHs-4sWmAONSZ4zoxUQJM/s1600/next5.jpg" imageanchor="1" style="clear: right; color: #cc4411; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmt-J8dMfMdXLY142Aw8rsq-XFaQL_uB1Ga2AesJeiiJfyzIeiWeYRyd-UIx46EeidaSdw0fXrYolPGn4uk8dQJjugiasqcYm-uV9Kdxuhtd8I-9mAEVtGPQ3HHs-4sWmAONSZ4zoxUQJM/s1600/next5.jpg" style="border: none; position: relative;" /></a></div>
Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com0tag:blogger.com,1999:blog-2483593764182960323.post-5323837677436368322013-05-23T07:55:00.000-07:002013-05-23T07:55:41.518-07:00161. Create Properties text file<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiD7ItqBo_AR0rk_WNug-11WmafP_ZazF0d55HeO2YoUv8sQtpOFd5P6RmFRdQxqIqYSUS969qHbstIbuPvW0zOvIPH48V9-9iSEtu0fAuiQEZfC-k088YycydgnmVmrJPrgxmmqw341Sd1/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiD7ItqBo_AR0rk_WNug-11WmafP_ZazF0d55HeO2YoUv8sQtpOFd5P6RmFRdQxqIqYSUS969qHbstIbuPvW0zOvIPH48V9-9iSEtu0fAuiQEZfC-k088YycydgnmVmrJPrgxmmqw341Sd1/s1600/PreviousPost2.jpg" /></a></div>
<br />
<br />
<br />
<br />
As already discussed in our earlier post, handling Parameterization with testng configuration XML file is preferable only when there are less number of parameters to be used in the Selenium Automation code. But if we want to use more number of parameters in our Selenium Automation code, one of the methods of doing it is to create Properties file with list of parameters and retrieve the listed parameters from the file and use them in our Selenium Automation code.<br />
<br />
<b>Follow the below steps to create a Properties text file:</b><br />
<br />
1. Create a new Package 'configparameters' as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl8sVjthgSquyYOtV_oV181I_eF_XN3piJjnAdWLU-27kpp7-h0W7oPhjY-TaqEM7odbVrOdqaF6Y4qtpD5tldHYFGIX___nYLCjgnNemh4ZDHWvP6JLFSPnSL7ENVImHJ69WoeqIeTf0y/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="322" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl8sVjthgSquyYOtV_oV181I_eF_XN3piJjnAdWLU-27kpp7-h0W7oPhjY-TaqEM7odbVrOdqaF6Y4qtpD5tldHYFGIX___nYLCjgnNemh4ZDHWvP6JLFSPnSL7ENVImHJ69WoeqIeTf0y/s400/1.jpg" width="400" /></a></div>
<br />
2. Right click on the package 'cofigparameters' and select New -> File option as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi20RsBvmVRwC7MltRCIQTOiLBN3iMMcdW8O2j3ggztzsKvwBCjcSJsVU_WbfVnN0mtU3aXeXCnLHByitaRrkd60QaYiFVy2_4yI1m3ry2SKo2-qk1BDeJ2rTP4Bjo7xtakIhbSaWKdtkFu/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="448" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi20RsBvmVRwC7MltRCIQTOiLBN3iMMcdW8O2j3ggztzsKvwBCjcSJsVU_WbfVnN0mtU3aXeXCnLHByitaRrkd60QaYiFVy2_4yI1m3ry2SKo2-qk1BDeJ2rTP4Bjo7xtakIhbSaWKdtkFu/s640/2.jpg" width="640" /></a></div>
<br />
<br />
3. Ensure that a 'New File' dialog is displayed, enter <b>Config.properties</b> into the 'File Name' field and click on 'Finish' button as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTaphMyBafltF_-BbgXpNeqGlLKMoXeR3OH8EuZinjcwijNSOwiX2ZFX9AyG910S3ceKSfgYAteclmPqMm2LtfhSX7tPCR2TwoljEkLQy1XAUWq7qnqb7pPGHovgjOqRbxtojpdnECvMJO/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTaphMyBafltF_-BbgXpNeqGlLKMoXeR3OH8EuZinjcwijNSOwiX2ZFX9AyG910S3ceKSfgYAteclmPqMm2LtfhSX7tPCR2TwoljEkLQy1XAUWq7qnqb7pPGHovgjOqRbxtojpdnECvMJO/s1600/3.jpg" /></a></div>
<br />
<br />
4. Ensure that <b>Config.properties</b> text file got created and opened as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ7K8oHx39NJCl-8L_qGlxDI5_vUiFLYvdM4qn_8WkROd5jPP9cxT1IzaIgV8ioxFANCuU04pXHz-DhRoqoH5wronVn3nlATOylCmHuoUUcZHhyphenhyphenLd1Z-wyyPKCVFaxgib9cMI6Cicg0pkD/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ7K8oHx39NJCl-8L_qGlxDI5_vUiFLYvdM4qn_8WkROd5jPP9cxT1IzaIgV8ioxFANCuU04pXHz-DhRoqoH5wronVn3nlATOylCmHuoUUcZHhyphenhyphenLd1Z-wyyPKCVFaxgib9cMI6Cicg0pkD/s1600/4.jpg" /></a></div>
<br />
<br />
5.<br />
<br />
<br />Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com2tag:blogger.com,1999:blog-2483593764182960323.post-6283878872030848102013-05-21T09:52:00.000-07:002013-05-23T06:10:35.203-07:00160. Parameterization with testng configuration file<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRuuPCA0Rt4VgO9s3he9iXXq61qZlr0nU2cUVte44CSmRloXe3UAyFfDdYfPnlBXqr_WqBdjJhcYshDi0OrnCalKEuGmlitHXDOIU0OJW3QHQt5dpeQ6BhquwEnnhMwoLeQiymsxN4PnhT/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRuuPCA0Rt4VgO9s3he9iXXq61qZlr0nU2cUVte44CSmRloXe3UAyFfDdYfPnlBXqr_WqBdjJhcYshDi0OrnCalKEuGmlitHXDOIU0OJW3QHQt5dpeQ6BhquwEnnhMwoLeQiymsxN4PnhT/s1600/PreviousPost2.jpg" /></a></div>
<br />
<br />
<br />
<b><span style="color: #cc0000;"><br /></span></b>
<b><span style="color: #cc0000;"><br /></span></b>
<b><span style="color: #cc0000;">testng.xml</span></b> configuration file can be used to parameterize the test data in the selenium automated tests.<br />
<br />
<b><span style="color: blue;">Follow the below steps for understanding the Parameterization with testng configuration file:</span></b><br />
<br />
1. Create a new Class file 'ChapterFourTests' under the <b>package67</b> of our previous project as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQfDT3rem0BfUm_NIO1n6BrqK6bEZ3YdZH8_ahr3BguKGVPzs4phyphenhyphenj1jTmxa8mHOfFhWXUpNlq5MSLuuPbsUXY5QcRZ2UjEuV4thvx7OX_CjllW1Y_VxvlZzdKxxKkfRrR4puyms3Cd9Dz/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQfDT3rem0BfUm_NIO1n6BrqK6bEZ3YdZH8_ahr3BguKGVPzs4phyphenhyphenj1jTmxa8mHOfFhWXUpNlq5MSLuuPbsUXY5QcRZ2UjEuV4thvx7OX_CjllW1Y_VxvlZzdKxxKkfRrR4puyms3Cd9Dz/s1600/2.jpg" /></a></div>
<br />
<br />
2.<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> Lets write the tests on 'Chapter4' page of '</span><a href="http://book.theautomatedtester.co.uk/" style="background-color: white; color: #771100; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-decoration: none;" target="_blank">http://book.theautomatedtester.co.uk/</a><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">' web application as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilibBdTE-cNjsi4E9EI1mbiP-p0mYUgoN_RklTvDs058u6jcfjXTX16B1g8OChgIfRUCcJcu9krHpxFiyNnumKa9MinYkFMgCoZMK5fIQxVzYoDcx33BwgZH-H3jd9XDY5-6BvaQvh_L6x/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilibBdTE-cNjsi4E9EI1mbiP-p0mYUgoN_RklTvDs058u6jcfjXTX16B1g8OChgIfRUCcJcu9krHpxFiyNnumKa9MinYkFMgCoZMK5fIQxVzYoDcx33BwgZH-H3jd9XDY5-6BvaQvh_L6x/s1600/3.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. The </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Java Class file '</span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">ChapterFourTests.java</span></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">' will look as shown in the below screenshot after writing the Selenium RC automation code for the test explained in the above step.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzTpJn6AdjcNU0avSp8-6VH8RP0OUX7_6ZQPoVbroa9etzNnsc5LFZmmEEiVingSNk-1ECPLnz4EUpfNvt0NAgVRzkmAY-xkmEQBfu40EEjaw4gmxAPCB0RRVLLt2A2DA9nGgaXrvYzaAW/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzTpJn6AdjcNU0avSp8-6VH8RP0OUX7_6ZQPoVbroa9etzNnsc5LFZmmEEiVingSNk-1ECPLnz4EUpfNvt0NAgVRzkmAY-xkmEQBfu40EEjaw4gmxAPCB0RRVLLt2A2DA9nGgaXrvYzaAW/s1600/4.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
4. Open the testng.xml configuration file using text editor as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHYTj9NW8Y13xXHJXrq1TRMjS29la6ly8zylvCkExkOG3H01A0loNY44GuowQdUV5RHSLitk1s00KoRzaZeYVZFK5xYUVyzLMyBasRSm7PtK782DyfCbypJNQYPBKndsdp0lIbx_0cy_zl/s1600/5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHYTj9NW8Y13xXHJXrq1TRMjS29la6ly8zylvCkExkOG3H01A0loNY44GuowQdUV5RHSLitk1s00KoRzaZeYVZFK5xYUVyzLMyBasRSm7PtK782DyfCbypJNQYPBKndsdp0lIbx_0cy_zl/s1600/5.jpg" /></a></div>
<br />
5. Add the class tag of the newly created Class 'ChapterFourTests' under the test category 'TestTwo' as shown below and save:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ306ieqmDPpzv6C91HerRdq8dfdUQzYFMWOUrTf0PvNETZtbrGwtDokxzS9nwbnFJPnOrWt7Vf6QIY-9bkhp7l7I6oh_tT16LWSNAjZEOR0F69Ovj2fJAFrnV_Dup5AbseUcTTBeqwx7Y/s1600/6.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ306ieqmDPpzv6C91HerRdq8dfdUQzYFMWOUrTf0PvNETZtbrGwtDokxzS9nwbnFJPnOrWt7Vf6QIY-9bkhp7l7I6oh_tT16LWSNAjZEOR0F69Ovj2fJAFrnV_Dup5AbseUcTTBeqwx7Y/s1600/6.jpg" /></a></div>
<br />
6. <span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Start the Selenium Standalone Server</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">7. Run the testng.xml configuration file using the TestNG as shown below:</span><br />
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFR7tBtt1lGLli5p7vD-Zrt4_AeIunG4xYeUDVz9vJnc-EFCtbhHlH6g207P64sdK1hl_bP8vHI732p349lKWx2bZr4ZKmMN2Aw8YEV9Zzp_pulzlhXNUu5MJgltqUGtWQDUcoQrBAW8NP/s1600/7.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFR7tBtt1lGLli5p7vD-Zrt4_AeIunG4xYeUDVz9vJnc-EFCtbhHlH6g207P64sdK1hl_bP8vHI732p349lKWx2bZr4ZKmMN2Aw8YEV9Zzp_pulzlhXNUu5MJgltqUGtWQDUcoQrBAW8NP/s1600/7.jpg" /></a></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">8. Ensure that all the tests got passed as shown below:</span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq7a-fPDG-b50FOvSKUAHEFtpN0DLC0chUuH0vwt0rizuSP-QTLxTN9Pp2XIVfXfG363rrOsyGvDxqRr453Zk1HWUTAyh3fDW119PUMRqSJKfTWR-an9MLKKvQaLMku29RH6IS_59WpCxc/s1600/8.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq7a-fPDG-b50FOvSKUAHEFtpN0DLC0chUuH0vwt0rizuSP-QTLxTN9Pp2XIVfXfG363rrOsyGvDxqRr453Zk1HWUTAyh3fDW119PUMRqSJKfTWR-an9MLKKvQaLMku29RH6IS_59WpCxc/s1600/8.jpg" /></a></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span></div>
<div>
<span style="color: blue; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><b>Now lets parameterize the test data 50 in the above passed test using the testng.xml configuration file by following the below steps:</b></span></span></div>
<div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span></div>
<div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">1. Open </span></span><a href="http://testng.org/doc/documentation-main.html#parameters" target="_blank">http://testng.org/doc/documentation-main.html#parameters</a> and copy the line containing the <parameter> tag as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxEJAs9tkK2lzlFXDfoACbZgLvn5sj3IOKgJovjreVNrDAg0DVwSufNfMCJJW511Uh88deesSNCR3rGHY4BnknRMelz3r3lwn_0bIsIelZ7AmFthASbBQUMMnomiTWvIRUa0kGtOCuED4N/s1600/9.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxEJAs9tkK2lzlFXDfoACbZgLvn5sj3IOKgJovjreVNrDAg0DVwSufNfMCJJW511Uh88deesSNCR3rGHY4BnknRMelz3r3lwn_0bIsIelZ7AmFthASbBQUMMnomiTWvIRUa0kGtOCuED4N/s1600/9.jpg" /></a></div>
<br /></div>
<div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">2. Open the testng.xml file using Text Editor and paste the above copied line as shown below:</span></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBZsu7p02ItZscJlC7oTsf8-zzO6WLg0nNHKYiT_omTyH-nOdYAspp95b9XoOg63R3wzEunLqCKmKjcAxB12YppXYH7EUVGc4YlVTUAYwNi-eTEWhFeDCjOX8ALp-PSBZxDQB4H1IVy4XU/s1600/10.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBZsu7p02ItZscJlC7oTsf8-zzO6WLg0nNHKYiT_omTyH-nOdYAspp95b9XoOg63R3wzEunLqCKmKjcAxB12YppXYH7EUVGc4YlVTUAYwNi-eTEWhFeDCjOX8ALp-PSBZxDQB4H1IVy4XU/s1600/10.jpg" /></a></div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">3. Now lets change the name attribute value to our desired name as shown below (In this example, I am changing it to <b>MONEY</b>):</span></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7kSXeC_eEMH-o5UH5SEfnHgbdx62oBanac-UAtEYVWXRtU6NsupMhgx3e-1slT-2_PvUNT7KokDskj6Gc7hO-YbObzpthoX6pebwdjeRLrqkFsbemRi45Spio1JP7dWY3dr95eNytkMHC/s1600/11.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7kSXeC_eEMH-o5UH5SEfnHgbdx62oBanac-UAtEYVWXRtU6NsupMhgx3e-1slT-2_PvUNT7KokDskj6Gc7hO-YbObzpthoX6pebwdjeRLrqkFsbemRi45Spio1JP7dWY3dr95eNytkMHC/s1600/11.jpg" /></a></div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">4. Now change the value attribute value to <b>50</b> as shown below and save:</span></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwNb5162DS9lhNgBXZ1PNN19UjOAGjBz8_5HubJ1IwgIkTbGXgcmYjd60it3jLWKMkWYDfdo1q-3udehsazh1YcRANInWfHLv-skmG3BGhj-RWiHBLh94fCRuA4JXpX3OkfWl4XC_UhObW/s1600/12.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwNb5162DS9lhNgBXZ1PNN19UjOAGjBz8_5HubJ1IwgIkTbGXgcmYjd60it3jLWKMkWYDfdo1q-3udehsazh1YcRANInWfHLv-skmG3BGhj-RWiHBLh94fCRuA4JXpX3OkfWl4XC_UhObW/s1600/12.jpg" /></a></div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">So in the steps 4 and 5, we have created a parameter variable MONEY and assigned a value 50 to it. We can use this Parameter variable MONEY in our selenium automation methods to represent the value 50.</span></span><br />
<br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">5. Open the Class file 'ChapterFourTests' and identify the value 50 in the code as shown below:</span></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvOPzpt1xNAXXzFC0aKQKRxEdT7sU7hIba04-eMXINSGtJUovVUeCMCEat4PuG89eKMWnPlKuhUsUBvsdscYF1JB_i-baHTu9kfcxOR8WzeLdX8RDsjQiXhY3U3UD9yUMUa61Z3-VRGPqB/s1600/13.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvOPzpt1xNAXXzFC0aKQKRxEdT7sU7hIba04-eMXINSGtJUovVUeCMCEat4PuG89eKMWnPlKuhUsUBvsdscYF1JB_i-baHTu9kfcxOR8WzeLdX8RDsjQiXhY3U3UD9yUMUa61Z3-VRGPqB/s1600/13.jpg" /></a></div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br />6. Replaced the identified value 50 with the Parameter Variable MONEY as shown below:</span></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsLvWZKsirlxNEC68plGT-wCozGiyklvFc0NDBjpI9DTeH0BtcvTWR4t22Fr9Ys9qQdBOwv1OWJtvYpXAzF6sgawSlskZMmu9NLFTchDUpZUrRvDh1bCM5GRtAB3bKX6O592EzLduPdOIi/s1600/14.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="468" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsLvWZKsirlxNEC68plGT-wCozGiyklvFc0NDBjpI9DTeH0BtcvTWR4t22Fr9Ys9qQdBOwv1OWJtvYpXAzF6sgawSlskZMmu9NLFTchDUpZUrRvDh1bCM5GRtAB3bKX6O592EzLduPdOIi/s640/14.jpg" width="640" /></a></div>
<br />
Observe that in the above screenshot, we got error messages with MONEY Parameter variable. In order to resolve these errors we've follow the below steps.<br />
<br />
7. Open <a href="http://testng.org/doc/documentation-main.html#parameters" target="_blank">http://testng.org/doc/documentation-main.html#parameters</a> and copy the line containing the @Parameters TestNG annotation as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi8Dh7zDq6A3eKz08OaTulYIyN_Sbcb0CmdhuGwxLiqRV2WHc28DgjIGUtaVVuAkK_-xQbcrENVEl585TiQYtYBA4NSTXYg_RDK4ewZrkh3Piyz2AS1Np2FvoPR7TYk6bhcnh6ja9KbLSM/s1600/15.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi8Dh7zDq6A3eKz08OaTulYIyN_Sbcb0CmdhuGwxLiqRV2WHc28DgjIGUtaVVuAkK_-xQbcrENVEl585TiQYtYBA4NSTXYg_RDK4ewZrkh3Piyz2AS1Np2FvoPR7TYk6bhcnh6ja9KbLSM/s1600/15.jpg" /></a></div>
<br />
8. <span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Open the Class file 'ChapterFourTests' and paste the copied line below the<b> @Test</b> TestNG annotation as shown below:</span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTbV0TIoaVdOIYmfjKDTOO-Ga69esncnwJw6YkwIwMWiPRFIm8iv1HwBVUZeKZ38rMamkU4ijEJGnD_3-8oxOK_dhwXNxDCXeNId7i940kyfOuAyrfNgJCJqbVz8pV5eYaIdTd6niswYxL/s1600/16.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTbV0TIoaVdOIYmfjKDTOO-Ga69esncnwJw6YkwIwMWiPRFIm8iv1HwBVUZeKZ38rMamkU4ijEJGnD_3-8oxOK_dhwXNxDCXeNId7i940kyfOuAyrfNgJCJqbVz8pV5eYaIdTd6niswYxL/s1600/16.jpg" /></a></div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">So we've added the @Parameters TestNG annotation to our automation code.</span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">9. Now replace the copied Parameter Variables with our Parameter Variable <b>MONEY</b> as shown below:</span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-3ku4AQyvAVWk_FPKqdJUNcpdOY_HK0nAZ0EQ5MSEtD5GMiQhslcctf8cuzBNCGfUiXvlIJ3QuNRvhnAJjNI7yinCjD45-IdFNz7ncbVRh1ryqCtq73dRTXIU1b8K5nZ8BCjzGERiSrcI/s1600/17.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-3ku4AQyvAVWk_FPKqdJUNcpdOY_HK0nAZ0EQ5MSEtD5GMiQhslcctf8cuzBNCGfUiXvlIJ3QuNRvhnAJjNI7yinCjD45-IdFNz7ncbVRh1ryqCtq73dRTXIU1b8K5nZ8BCjzGERiSrcI/s1600/17.jpg" /></a></div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">Observe that the error message are still displayed. Follow the below steps to resolve this error messages.</span></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">10. Declare the Parameter variable as String type in the parenthesis of the method as shown below and save:</span></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0PqfN-FBQqZS9lr-CqOrbLHQTKihsoYQGASuBJWFL7_jBkgwpv8Wv6zCpEdXBiiyMeDyE_mzFlbbcANtgPSEsBalLGwTTQBOphoEp4UCEdkCu1K8-XYEKBVCQY8ZoswFpKeLJ2tvrDCRm/s1600/18.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0PqfN-FBQqZS9lr-CqOrbLHQTKihsoYQGASuBJWFL7_jBkgwpv8Wv6zCpEdXBiiyMeDyE_mzFlbbcANtgPSEsBalLGwTTQBOphoEp4UCEdkCu1K8-XYEKBVCQY8ZoswFpKeLJ2tvrDCRm/s1600/18.jpg" /></a></div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">Observe that the error messages got resolved as they are not displayed in the above screenshot.</span></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">This is how we parameterize the test data in Selenium Automation Code. Now lets see, whether our test runs successfully after Parameterization of test data 50 in this example by following the below steps.</span></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">11. Start the Selenium Standalone Server</span></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">12. Run the testng.xml configuration file using TestNG as shown below:</span></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjlzBp4w3sZ08VuddcjjgY42ZUJIlZ5kJHw0LIdbrlzq85-tWck-ubyWW39RxH4mEqk0F6Gaqgndp1qyXCGy-ys0pDU7JkRvgxDs2Soa4NDjPsY7l8yM5ni8YNp5OndK_1y5uBzrGXb-u9/s1600/19.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjlzBp4w3sZ08VuddcjjgY42ZUJIlZ5kJHw0LIdbrlzq85-tWck-ubyWW39RxH4mEqk0F6Gaqgndp1qyXCGy-ys0pDU7JkRvgxDs2Soa4NDjPsY7l8yM5ni8YNp5OndK_1y5uBzrGXb-u9/s1600/19.jpg" /></a></div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">13. Observe that </span></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">all the tests including the test containing the parameterized variable got passed as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyM0mYtukMGR4VCALl2IVzvTSN1yYZ8fTSgeTinRTzrl7QNDHsPiIdu1oir7vWUpMD9bWRN4Bf0CRV1p-cQB9bcfWGu5Gu_lvOZHMxSoq9X2nXm5rwnSuHlgQxspDXj3Wk43MyL9C6n7II/s1600/20.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyM0mYtukMGR4VCALl2IVzvTSN1yYZ8fTSgeTinRTzrl7QNDHsPiIdu1oir7vWUpMD9bWRN4Bf0CRV1p-cQB9bcfWGu5Gu_lvOZHMxSoq9X2nXm5rwnSuHlgQxspDXj3Wk43MyL9C6n7II/s1600/20.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: blue; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><b>In the similar manner, lets parameterize few other things in our selenium RC test automation code by following the below steps:</b></span></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">1. </span></span><span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Open the Class file 'ChapterFourTests' and</span><span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"> Create parameter variables for the following highlighted things on the screenshot as shown below:</span></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIIh6Oio5jrWC-C_GgTTSjIaM2K85NHOC5PW1HOdc7NPatjbHwlYg7vlyS8IX9wJ6u6x2lthsIXJ6o5rz5rHWH1ufpXDyu1bXvDPLK1fjHOvvJn6q_VLqO4u1g1KVo8UE1hYV_tCfxxwnq/s1600/21.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIIh6Oio5jrWC-C_GgTTSjIaM2K85NHOC5PW1HOdc7NPatjbHwlYg7vlyS8IX9wJ6u6x2lthsIXJ6o5rz5rHWH1ufpXDyu1bXvDPLK1fjHOvvJn6q_VLqO4u1g1KVo8UE1hYV_tCfxxwnq/s1600/21.jpg" /></a></div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">2. Open the testng.xml configuration file using the Text Editor and create parameter tags for all the above high lighted things as shown below and save:</span></span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYRWNSwHc493zlsJmYumMz2pQB3FfIB8LjsafNpnj0yUewMt43rMlnc65VO7FYXa-esgbDb_auWDrFJiFoBZjy_ja6VTh5KyzFKtM3Zb4p_euQK-lAl1ZRO2a2d3pvKMaheM5hEFhMQIsG/s1600/34.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYRWNSwHc493zlsJmYumMz2pQB3FfIB8LjsafNpnj0yUewMt43rMlnc65VO7FYXa-esgbDb_auWDrFJiFoBZjy_ja6VTh5KyzFKtM3Zb4p_euQK-lAl1ZRO2a2d3pvKMaheM5hEFhMQIsG/s1600/34.jpg" /></a></div>
<br />
<br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">3. Now open 'ChapterOneTests' Java class file and update the respective method with the above created parameters as shown below and save:</span></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZpL7Mh9vSlg4V61rZEp9TGTnjhv-1VD9rKvTyVPHDowvoNRdB9QfPz8Wo1NltpwqdnsQNjzYV8XMe3e_cdo1p3MDNE_zUyK-QuJaVwnP4KQ34swoyy9IXKAlh1kICsM0euGurjhQR_zBL/s1600/28.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZpL7Mh9vSlg4V61rZEp9TGTnjhv-1VD9rKvTyVPHDowvoNRdB9QfPz8Wo1NltpwqdnsQNjzYV8XMe3e_cdo1p3MDNE_zUyK-QuJaVwnP4KQ34swoyy9IXKAlh1kICsM0euGurjhQR_zBL/s1600/28.jpg" /></a></div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">4. In the similar manner, open the 'ChapterTwoTests' Java Class file and </span></span><span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">update the respective method with the parameters as shown below and save:</span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbNaE3DUeos72InUXRYIzv-ojeEe0hDs-PvaMBTpp4Ewi6Fp5rgwTbLMDa4cfZQML9BWF48_24IEot6JKsZpZ5079FfsNRXhkDwpiG1CfGbmOOoBoF_TE4ysjeKdca0Lxm5-XoADgOlmk9/s1600/29.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbNaE3DUeos72InUXRYIzv-ojeEe0hDs-PvaMBTpp4Ewi6Fp5rgwTbLMDa4cfZQML9BWF48_24IEot6JKsZpZ5079FfsNRXhkDwpiG1CfGbmOOoBoF_TE4ysjeKdca0Lxm5-XoADgOlmk9/s1600/29.jpg" /></a></div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">5. In the similar manner, open the 'ChapterThreeTests' Java Class file and </span></span><span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">update the respective method with the parameters as shown below and save:</span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiXqZ4liskz3laBuoNHVoC4naNFgl9v31jeQRWRcN2V9xriodQaCyIRhm-24_Tc9H90k7hcUGMkkliMvg6RmfdiAZHmG7Ri2UL5ocasW3H1E8q2b30NwlBVXUJLinYOpgBfn4yQJ4Yfylz/s1600/30.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiXqZ4liskz3laBuoNHVoC4naNFgl9v31jeQRWRcN2V9xriodQaCyIRhm-24_Tc9H90k7hcUGMkkliMvg6RmfdiAZHmG7Ri2UL5ocasW3H1E8q2b30NwlBVXUJLinYOpgBfn4yQJ4Yfylz/s1600/30.jpg" /></a></div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">6. In the similar manner, open the 'ChapterFourTests' Java Class file and </span></span><span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">update the respective method with the parameters as shown below and save:</span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5Dw8V_XAZWDR1Tn6QKDsoYHd8Dd4CtQMYsonurRwMBAksnWYko5zWU1sHBiHVHPRODH7daZTGp7i7eAvNHIvMXF_qD2b9jcjvVlopKH1fVWhS4fmkUiNakSh5ZcMBjK0WB1anfJNg_qKR/s1600/31.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5Dw8V_XAZWDR1Tn6QKDsoYHd8Dd4CtQMYsonurRwMBAksnWYko5zWU1sHBiHVHPRODH7daZTGp7i7eAvNHIvMXF_qD2b9jcjvVlopKH1fVWhS4fmkUiNakSh5ZcMBjK0WB1anfJNg_qKR/s1600/31.jpg" /></a></div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">7. Start the Selenium Standalone Server</span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">8. Run the testng.xml configuration file using TestNG as shown below:</span></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXqYsugcgKFBX1KdSUAXDmD0XdLDP3o2R30jLywzLl8qshnO3rIAMyuUy0-kQAMHtgtsMpv0FlE5h8qUHUA7ty7ptEk8kAC_w8wBAkz47vMlKP2ei9dsG9M20YnPuP716ycic7jUPxKpgp/s1600/32.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="469" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXqYsugcgKFBX1KdSUAXDmD0XdLDP3o2R30jLywzLl8qshnO3rIAMyuUy0-kQAMHtgtsMpv0FlE5h8qUHUA7ty7ptEk8kAC_w8wBAkz47vMlKP2ei9dsG9M20YnPuP716ycic7jUPxKpgp/s640/32.jpg" width="640" /></a></div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">9. Observe that all the tests are passed as shown below:</span></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgje5gR0Gn5yZciPrqbzdmFsszR6kq6bAiUvswgdi1zONqGj_n2n9jdk2V9MkCnd_eDIWt6WrxlwOqr0rW7lSHWMEa2kR7v0gRs8eIwTjTPic26nAVrv__6H7WTUtMBqtRDELiE9yUKXa-f/s1600/33.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgje5gR0Gn5yZciPrqbzdmFsszR6kq6bAiUvswgdi1zONqGj_n2n9jdk2V9MkCnd_eDIWt6WrxlwOqr0rW7lSHWMEa2kR7v0gRs8eIwTjTPic26nAVrv__6H7WTUtMBqtRDELiE9yUKXa-f/s1600/33.jpg" /></a></div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">This is how we have to implement Parameterization with testng configuration file.</span></span><br />
<span style="background-color: white;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span></span>
<span style="background-color: white;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">The Parameterization using testng.xml configuration file will be useful only when you have less number of parameters. </span></span></span><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">How to deal with a large number of parameters will be explained in the upcoming posts.</span></span><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Download this Project:</span></b><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFQ3ubkmtpiVh9v97qwmRH6Uwyj3F52qlsd57w2zg5S3YCzP80tNIRcOEpTGGcGmDn_GxCbH-PQ_mrVAi28JEA8KeWTLXwUWio3oYD08uNbCVFFHikpnHz2aHPGqJlUq9HWRzZhOhEO0_C/s1600/next5.jpg" imageanchor="1" style="background-color: white; clear: right; color: #771100; float: right; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; margin-left: 1em; text-align: center; text-decoration: none;"><br /></a><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i><a href="http://www.mediafire.com/download/ghg338uguqx0p1b/RC-Project67.zip" target="_blank">Click here</a></i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to download this project and import into Eclipse IDE on your machine.</span><br />
<br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br />
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<b><span style="color: #cc0000;"><br /></span></b><span style="color: #38761d;"><b><i><u>Create Properties file</u><span style="color: #333333;"> </span></i><span style="color: #333333;"> </span>will be explained in the next post.</b></span></div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" imageanchor="1" style="clear: right; color: #771100; float: right; margin-bottom: 1em; margin-left: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" style="border: none; position: relative;" /></a></div>
<br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span><span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
</div>
Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com0tag:blogger.com,1999:blog-2483593764182960323.post-16638503206377973172013-05-21T07:41:00.000-07:002013-05-23T00:43:25.393-07:00159. Parameterization of test data<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinlXf549BZmAJZmaJnnUSePd_8a7AXeDv7R2Z0mSYAdxXzTr0m-jVGM40Sapde81bLNeI7H-GtJycDA49vGT5552VCw-8P6HTgzMVRp6XtiMJPUT4i8oSvmzewV_8L3m8jTSuC0M0SM6Si/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinlXf549BZmAJZmaJnnUSePd_8a7AXeDv7R2Z0mSYAdxXzTr0m-jVGM40Sapde81bLNeI7H-GtJycDA49vGT5552VCw-8P6HTgzMVRp6XtiMJPUT4i8oSvmzewV_8L3m8jTSuC0M0SM6Si/s1600/PreviousPost2.jpg" /></a></div>
<br />
<br />
<br />
<br />
<b><br /></b>
<b><br /></b>
<b>What is a Parameter ?</b><br />
<br />
A parameter is a special kind of variable. A parameter type variable is used in methods/functions to refer to the data that is passed as arguments to the methods/functions.<br />
<br />
<b>Example in Java Programming Language:</b><br />
<br />
<u>Method/Function containing Parameters:</u><br />
<br />
public void <b>add</b>(int a, int b)<br />
{<br />
System.out.println("The value of the parameter <b>a</b> is "+a);<br />
System.out.println("The value of the parameter <b>b</b> is "+b);<br />
}<br />
<br />
<u>Calling the above method or function to pass the data as arguments:</u><br />
<br />
add(5,6);<br />
<br />
<u>Output of this Program:</u><br />
<br />
The value of the parameter a is 5<br />
The value of the parameter b is 6<br />
<br />
After looking at this example, its very clear that the values in the method call i.e. 5 and 6 are nothing but the data to be passed to the Method or Function. So these data is technically called as arguments. This arguments when passed to the Method/Function will be assigned to the parameter variables of the method/function i.e. integer variables a and b in this example. So finally we use these parameter variables in the method/function to represent the argument values that are passed to the method. Hence on printing a and b parameter variables inside the above method/function , the argument values 5 and 6 get printed.<br />
<br />
<b>What is Parameterization ?</b><br />
<br />
Parameterization is the process of replacing the values inside the methods with parameter variables. We will pass the replaced values from an external file to the respective parameter variables in the method.<br />
<br />
Hence in Test Automation code, Parameterization concept is used to replace the test data in methods with parameter variables and the replaced test data is then passed from an external file to the respective parameters in methods as arguments.<br />
<br />
<b>Naming Convention for Parameters </b><br />
<br />
As we already know that we've to use the following naming conventions for Class names and Method names:<br />
<br />
<u><b>Class </b>naming conventions:</u><br />
<br />
<ul>
<li>Should start with Capital Letter</li>
<li>If the Class Name contains Two words, we've to start all the words with a Capital letter</li>
<li>Remaining Letters in the words need to be in small.</li>
</ul>
<div>
Examples for Class Naming Conventions:</div>
<div>
<ul>
<li><b>F</b>acebook</li>
<li><b>F</b>acebook<b>F</b>riends</li>
<li><b>F</b>acebook<b>P</b>rivate<b>G</b>roups</li>
</ul>
</div>
<div>
<u><b>Method</b> naming convention:</u></div>
<div>
<ul>
<li>Should start with a small letter</li>
<li>If the Method Name contains more than one words, we've to start all the words except the first word with a Capital letter</li>
<li>Remaining Letters in the words need to be in small.</li>
</ul>
<div>
Examples for Method Naming Conventions:</div>
<div>
<ul>
<li><b>f</b>acebook</li>
<li><b>f</b>acebook<b>F</b>riends</li>
<li><b>f</b>acebook<b>P</b>rivate<b>G</b>roups</li>
</ul>
</div>
</div>
<div>
In the similar manner we've to use the following naming conventions for Parameters:</div>
<div>
<br /></div>
<div>
<u><b>Parameter</b> naming convention:</u></div>
<div>
<ul>
<li>All the Letters should be in Capital</li>
<li>If the Parameter Name contains more than one words, we've to separate all the words with underscore (i.e. _ )</li>
</ul>
<div>
Examples for Class Naming Conventions:</div>
<div>
<ul>
<li><b>FACEBOOK</b></li>
<li><b>FACEBOOK_FRIENDS</b></li>
<li><b>FACEBOOK_PRIVATE_GROUPS</b></li>
</ul>
</div>
</div>
<br />
<br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b><span style="background-color: white; color: #38761d; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><i><u>Parameterization with testng configuration file</u></i> will be explained in the next post.</b></span><span style="background-color: white; color: #38761d; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><br /></b></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5b_PTso9MKo0oOmnCRrCec5boSXc_U4WgkzB4lTBeFCCs0KS2a6439XpBnaMDVFYcSNBgoP7qeroN-z10ad3FLxNhJ_EZjiIW2D-uRFj6XgmrD_WLIZSII7o0uSVSjunqlMIwYIvWeScV/s1600/next5.jpg" imageanchor="1" style="clear: right; color: #cc4411; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5b_PTso9MKo0oOmnCRrCec5boSXc_U4WgkzB4lTBeFCCs0KS2a6439XpBnaMDVFYcSNBgoP7qeroN-z10ad3FLxNhJ_EZjiIW2D-uRFj6XgmrD_WLIZSII7o0uSVSjunqlMIwYIvWeScV/s1600/next5.jpg" style="border: none; position: relative;" /></a></div>
<br />
<br />
<br />
<br />Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com0tag:blogger.com,1999:blog-2483593764182960323.post-75650567870454444582013-05-21T02:57:00.005-07:002013-05-21T09:23:44.382-07:00158. Understanding the usage of verbose attribute in testng configuration file<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiS7UaVZeN2YR_nTD8ZplZ5_SneVMkoanC3lWfiKLJJ3sur0j4da4Ncrjc66jwFkiO37K1MeRfgdSJ_f_vHbx7A9K_5uKP0TwdOZqAKrYIl-EJ-O0VTcqYzYMtbLWC7vFhV4MO3XxRKMmK/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiS7UaVZeN2YR_nTD8ZplZ5_SneVMkoanC3lWfiKLJJ3sur0j4da4Ncrjc66jwFkiO37K1MeRfgdSJ_f_vHbx7A9K_5uKP0TwdOZqAKrYIl-EJ-O0VTcqYzYMtbLWC7vFhV4MO3XxRKMmK/s1600/PreviousPost2.jpg" /></a></div>
<br />
<br />
<br />
<br />
<b><span style="color: #cc0000;"><br /></span></b>
<b><span style="color: #cc0000;">verbose</span></b> attribute is used in the <suite> tag of testng.xml configuration file as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjURT3OnE0AwcvvZvp5XdfwglPz0HUoSPQMMPXHISK23KaoiR_lvDJqsKanCzLOzAHk54tGnMI4rg1KA5L5qddbwFrlVJoScYqkvN24LS-apnuaHbqIC4UonkdHUb1Aup2n7Lv94sUSHzVn/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjURT3OnE0AwcvvZvp5XdfwglPz0HUoSPQMMPXHISK23KaoiR_lvDJqsKanCzLOzAHk54tGnMI4rg1KA5L5qddbwFrlVJoScYqkvN24LS-apnuaHbqIC4UonkdHUb1Aup2n7Lv94sUSHzVn/s1600/1.jpg" /></a></div>
<br />
<br />
<b><span style="color: blue;"><br /></span></b>
<b><span style="color: blue;"><br /></span></b>
<b><span style="color: blue;">Why should we use the verbose attribute in testng.xml configuration file ?</span></b><br />
<br />
Before understanding the usage of verbose attribute, first you have to know the values it can accept. Verbose attribute can takes values from 1 to 10 as shown below:<br />
<br />
verbose="1"<br />
verbose="2"<br />
verbose="3"<br />
verbose="4"<br />
verbose="5"<br />
verbose="6"<br />
verbose="7"<br />
verbose="8"<br />
verbose="9"<br />
verbose="10"<br />
<br />
If we specify the verbose attribute with smaller number, then the test results log details in the Eclipse IDE -> 'console' window will be less. But if you want to get more details and want to see more clarity on the test results log details in the Eclipse IDE -> 'console' window then you have to assign larger number to the verbose attribute.<br />
<br />
<b><span style="color: blue;">Lets find out, how the verbose attribute value effects the log details in the Eclipse IDE console window by following the below steps:</span></b><br />
<br />
1. Open the <b>testng.xml</b> configuration file in our previous project, by right clicking on the <b>testng.xml</b> file and selecting to open with <b>Text Editor</b> as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg68mrFX2-p2JbJEDO6sWsIU7dxxGJ0XwKMiLGwh_thzeibZyEK5ZoEmbHnpCmQVfU2THiE4hL7ABLvhp6XbVqDMHqTsdxDjVqoPOAAAwlEtYHOzgbn_DICchwwAFmvcKt_j4R8hkN613H5/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg68mrFX2-p2JbJEDO6sWsIU7dxxGJ0XwKMiLGwh_thzeibZyEK5ZoEmbHnpCmQVfU2THiE4hL7ABLvhp6XbVqDMHqTsdxDjVqoPOAAAwlEtYHOzgbn_DICchwwAFmvcKt_j4R8hkN613H5/s1600/2.jpg" /></a></div>
<br />
2. Ensure that the testng.xml configuration file got opened in the Text Editor and make sure that verbose attribute value is set to 1 as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhwnoW8_E0oyVJ7YB_rjJfIZgT4_vYirP-Eq_LGXccOE05mBfJxXnleEWESvHVVQBs-Mh3C4zbrKRgElFd4QOdvgwnNEQ9NMg0EjccYXMHxsSjMH9VS2hyc0hbTxzRlfCo1Nr3M9DAZqsB/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhwnoW8_E0oyVJ7YB_rjJfIZgT4_vYirP-Eq_LGXccOE05mBfJxXnleEWESvHVVQBs-Mh3C4zbrKRgElFd4QOdvgwnNEQ9NMg0EjccYXMHxsSjMH9VS2hyc0hbTxzRlfCo1Nr3M9DAZqsB/s1600/3.jpg" /></a></div>
<br />
<br />
3. Start the Selenium Standalone Server<br />
4. Run the testng.xml configuration file using the TestNG as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEit39PW3lFl33Mr3-0CSrHvF2uHELmy2F5mlY09h8J-4hwM63A59VaqPmgiwAtWdGlnwrH6-SaVpP4BmPOjFtJ0FFcSRcA3oIqy63qU92Q2GuUiFrAN3pwWq_miHX-4UMHcHzjLHwkqtV2F/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEit39PW3lFl33Mr3-0CSrHvF2uHELmy2F5mlY09h8J-4hwM63A59VaqPmgiwAtWdGlnwrH6-SaVpP4BmPOjFtJ0FFcSRcA3oIqy63qU92Q2GuUiFrAN3pwWq_miHX-4UMHcHzjLHwkqtV2F/s1600/4.jpg" /></a></div>
<br />
<br />
5. Observe that all the tests in the project got executed successfully and the log details of the test results got displayed in the 'Console' window with very short info as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaSCHHr0yPaOiGVGgyrAq4qcaRdTvZ0rbgpmpJ1IqK3oIvutrHYcuyjrm908_8TSS7FAz7Tk1zcMaAN5QselofhYkGaJMkwQJYkccKb4Q14KPbUKlev4H7uGaKUuWdoTCYiRLXycFhOesV/s1600/5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="331" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaSCHHr0yPaOiGVGgyrAq4qcaRdTvZ0rbgpmpJ1IqK3oIvutrHYcuyjrm908_8TSS7FAz7Tk1zcMaAN5QselofhYkGaJMkwQJYkccKb4Q14KPbUKlev4H7uGaKUuWdoTCYiRLXycFhOesV/s640/5.jpg" width="640" /></a></div>
<br />
<br />
<br />
6. Now lets once again edit the testng.xml configuration by changing the value of verbose attribute to<b> 2</b> as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpFD30gFiHjocEhFAis46Y_654EoP5k5J_a0T5tXKeshPokMSyHBGN14UMl4PCjXEg06otG4Bi6e9gSxbGOkyT8zDcACILc94q_124YIzNXjNZfkKELUGxdbF93UF8ZlB-M-8bE4fL2qib/s1600/6.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpFD30gFiHjocEhFAis46Y_654EoP5k5J_a0T5tXKeshPokMSyHBGN14UMl4PCjXEg06otG4Bi6e9gSxbGOkyT8zDcACILc94q_124YIzNXjNZfkKELUGxdbF93UF8ZlB-M-8bE4fL2qib/s1600/6.jpg" /></a></div>
<br />
<br />
7. Ensure that the Selenium Standalone Server is still running<br />
8. Run the testng.xml configuration file using the TestNG as shown below (i.e. we are running the testng.xml file containing the verbose value specified as 2):<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTt2_16-hUPC1K6eFHvfj4Xh2XHR8umgzBTuAdxu3tI0PHl-w2h2ULDL2g_Bh6e6nLqhYh3MOgWOL2LnKTt6KYXloj5TiC7m4JWa3o3kkFagEmP97-w3m_70GxzhzNMtKd4pM5C41oKYKW/s1600/7.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="412" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTt2_16-hUPC1K6eFHvfj4Xh2XHR8umgzBTuAdxu3tI0PHl-w2h2ULDL2g_Bh6e6nLqhYh3MOgWOL2LnKTt6KYXloj5TiC7m4JWa3o3kkFagEmP97-w3m_70GxzhzNMtKd4pM5C41oKYKW/s640/7.jpg" width="640" /></a></div>
<br />
<br />
<b><span style="color: blue;">To Conclude:</span></b><br />
<br />
<ul>
<li>You can increase the verbose attribute value till 10. </li>
<li>The log details in the console window will get more detailed and more clear as you increase the value of the verbose attribute in the testng.xml configuration file.</li>
</ul>
<br />
<br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b><span style="background-color: white; color: #38761d; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><i><u>Parameterization of test data</u></i> will be explained in the next post.</b></span><span style="background-color: white; color: #38761d; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><br /></b></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5b_PTso9MKo0oOmnCRrCec5boSXc_U4WgkzB4lTBeFCCs0KS2a6439XpBnaMDVFYcSNBgoP7qeroN-z10ad3FLxNhJ_EZjiIW2D-uRFj6XgmrD_WLIZSII7o0uSVSjunqlMIwYIvWeScV/s1600/next5.jpg" imageanchor="1" style="clear: right; color: #cc4411; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5b_PTso9MKo0oOmnCRrCec5boSXc_U4WgkzB4lTBeFCCs0KS2a6439XpBnaMDVFYcSNBgoP7qeroN-z10ad3FLxNhJ_EZjiIW2D-uRFj6XgmrD_WLIZSII7o0uSVSjunqlMIwYIvWeScV/s1600/next5.jpg" style="border: none; position: relative;" /></a></div>
<br />
<br />
<br />Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com15tag:blogger.com,1999:blog-2483593764182960323.post-62307158278617687312013-05-20T03:45:00.000-07:002013-05-21T02:17:36.294-07:00157. Creating testng.xml configuration file and Running it using TestNG<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggrikvJZskfliI0gXtYe2JzUNA0PFFd4m5lRfBdGBa9yDpLN0WcXkyYm4Wvl9FREJ9KBcJrSzNgSaFqjIVjANHP_ypXLaVnJeunj6kiMiL4eaEa38qrTwnb6hIYTLUevSE4p8k3j6yNYhu/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggrikvJZskfliI0gXtYe2JzUNA0PFFd4m5lRfBdGBa9yDpLN0WcXkyYm4Wvl9FREJ9KBcJrSzNgSaFqjIVjANHP_ypXLaVnJeunj6kiMiL4eaEa38qrTwnb6hIYTLUevSE4p8k3j6yNYhu/s1600/PreviousPost2.jpg" /></a></div>
<br />
<br />
<br />
<br />
<br />
We can run a batch of tests by creating a <b> <span style="color: blue;">test</span><span style="color: #cc0000;">ng</span>.xml </b>configuration XML file and Running it using the TestNG. And also we can generate graphical test reports by running it.<br />
<br />
Before creating a testng.xml configuration XML file, first lets create tests by following the below steps:<br />
<br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Create a new Project say 'RC-Project67' in Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Configure the Project to work with Selenium RC</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. Configure the Selenium Standalone Server to run from Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Create a package say 'package67' under the newly created project.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Create a Java Class files say '</span><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">ChapterOneTests</span></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">', '</span><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">ChapterTwoTests</span></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">', '</span><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">ChapterThreeTests</span></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">' under the newly created package as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGgunrDDpQGaPGNprtoGxvDnMMfeN0YObYMxhMk5yV4sE8yYt-YU2k9FifAkgbzJhyphenhyphenuDkzGH9P2T0XFliuU-AxPnwKhcaSMEGdPq8CJSTg-CsIBd8Bt5Ws5yIpCoYXP9XauTnM6jH6TNFw/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGgunrDDpQGaPGNprtoGxvDnMMfeN0YObYMxhMk5yV4sE8yYt-YU2k9FifAkgbzJhyphenhyphenuDkzGH9P2T0XFliuU-AxPnwKhcaSMEGdPq8CJSTg-CsIBd8Bt5Ws5yIpCoYXP9XauTnM6jH6TNFw/s1600/1.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
6. Lets write the tests on 'Chapter1' page of '<a href="http://book.theautomatedtester.co.uk/" target="_blank">http://book.theautomatedtester.co.uk/</a>' web application as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigdpttjSNgwzf-bMiy9xEmJJ78S8qTw57XmYQAHN5i7jugrZpUf2-Lm8AYeQHXz6Fm_xVULULj8zYioiVka2VSvpRuQIUw9GXWKK7mMy0514nByewph4HlCzExEKsLJT3MjkTnAImDoaT4/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigdpttjSNgwzf-bMiy9xEmJJ78S8qTw57XmYQAHN5i7jugrZpUf2-Lm8AYeQHXz6Fm_xVULULj8zYioiVka2VSvpRuQIUw9GXWKK7mMy0514nByewph4HlCzExEKsLJT3MjkTnAImDoaT4/s1600/2.jpg" /></a></div>
<br />
7. The <span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Java Class file '</span><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">ChapterOneTests.java</span></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">' will look as shown in the below screenshot after writing the Selenium RC automation code for the tests explained in the above step.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp_0jPo5uKUAdcMDbrv7ZBmlG8ah2TLdrSnUjUdoTlR3YFQPftWbVYrv5ux84lqN5_FAQ7F8jvyoJjtMGICxLilWbkmjqVBiZ4gVhlC8R32OCjghu1p9EP5nx2of6sCG8Wpz5uHs_g1UiQ/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp_0jPo5uKUAdcMDbrv7ZBmlG8ah2TLdrSnUjUdoTlR3YFQPftWbVYrv5ux84lqN5_FAQ7F8jvyoJjtMGICxLilWbkmjqVBiZ4gVhlC8R32OCjghu1p9EP5nx2of6sCG8Wpz5uHs_g1UiQ/s1600/3.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
8. Lets write the tests on 'Chapter2' page of '<a href="http://book.theautomatedtester.co.uk/" target="_blank">http://book.theautomatedtester.co.uk/</a>' web application as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9XZsOKH5x5X5eKWv_hF52C-N1va2Ne2unhKx16B02Z0ik8znD890jIfrS0W3utsedHV-TAtwBzcPr0RQQkAzYD8QXFIU_M5WCqNNt9OpzkVD2-pvSuvz_fGNEVHr5i0Xzn4lMsPn61OC7/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9XZsOKH5x5X5eKWv_hF52C-N1va2Ne2unhKx16B02Z0ik8znD890jIfrS0W3utsedHV-TAtwBzcPr0RQQkAzYD8QXFIU_M5WCqNNt9OpzkVD2-pvSuvz_fGNEVHr5i0Xzn4lMsPn61OC7/s1600/4.jpg" /></a></div>
<br />
9. The <span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Java Class file '</span><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">ChapterTwoTests.java</span></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">' will look as shown in the below screenshot after writing the Selenium RC automation code for the tests explained in the above step.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4ZDTp50pJcpcqRH-vh8aOpkpgptGIGBmBh6vUwETp5JbJ7HPQd12Ho8wNRU_gngnBh3O4NIyrsRDZOuGbiyOeyglFYaqBO82cfZleKjpG7Bjxkr-IJMPd-Bka9PQqk0x3twqGzgJ2sJPe/s1600/5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4ZDTp50pJcpcqRH-vh8aOpkpgptGIGBmBh6vUwETp5JbJ7HPQd12Ho8wNRU_gngnBh3O4NIyrsRDZOuGbiyOeyglFYaqBO82cfZleKjpG7Bjxkr-IJMPd-Bka9PQqk0x3twqGzgJ2sJPe/s1600/5.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
10. Lets write the tests on 'Chapter3' page of '<a href="http://book.theautomatedtester.co.uk/" target="_blank">http://book.theautomatedtester.co.uk/</a>' web application as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkhlp1MWh3H-j8_HTvVH2Jq90dQqkfd3YeSs_3rwc-c-7j6VFjpgoS5nH3XJmZwXFkqnEC1Y3ovUu6JLS7Bf8FYPDvuxuyCNUXKfvZxfWPKVo0XeoYstbor0h1rEZtqo1x4RkGvLIcQsTF/s1600/6.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkhlp1MWh3H-j8_HTvVH2Jq90dQqkfd3YeSs_3rwc-c-7j6VFjpgoS5nH3XJmZwXFkqnEC1Y3ovUu6JLS7Bf8FYPDvuxuyCNUXKfvZxfWPKVo0XeoYstbor0h1rEZtqo1x4RkGvLIcQsTF/s1600/6.jpg" /></a></div>
<br />
11. The <span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Java Class file '</span><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">ChapterThreeTests.java</span></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">' will look as shown in the below screenshot after writing the Selenium RC automation code for the tests explained in the above step.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxq8J0VOz9qXhznwd1P9CUHbRA4jmCEwyyVgG9YvxaeuPMbSosIy2ohMA1auu2txHGnKLHCaJTG0ODd4-JB5SVXAfPus-dW_jfVFR0ANVDpbrLa4uYkEuDxUcU_OvbOOQQ7eFsKrulc5-y/s1600/7.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxq8J0VOz9qXhznwd1P9CUHbRA4jmCEwyyVgG9YvxaeuPMbSosIy2ohMA1auu2txHGnKLHCaJTG0ODd4-JB5SVXAfPus-dW_jfVFR0ANVDpbrLa4uYkEuDxUcU_OvbOOQQ7eFsKrulc5-y/s1600/7.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">12. Save all the Java Class files </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> '</span><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">ChapterOneTests</span></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">', '</span><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">ChapterTwoTests</span></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">', '</span><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">ChapterThreeTests</span></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">' by click on the 'Save All' option on Eclipse IDE as shown below:</span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhc8BdN7JZynLWjKokMAN2jKkl65wm8-dZhqZ3ilf013_ZNndLrP7E_hxY2Yes5yEaF2_PfqsaxUJZsQrQQ7ojBZmIbaRPLGK4O11536NBcPwaYgtbx2u_Rjr5toOpBH1UYkbP2AivfaAub/s1600/8.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhc8BdN7JZynLWjKokMAN2jKkl65wm8-dZhqZ3ilf013_ZNndLrP7E_hxY2Yes5yEaF2_PfqsaxUJZsQrQQ7ojBZmIbaRPLGK4O11536NBcPwaYgtbx2u_Rjr5toOpBH1UYkbP2AivfaAub/s1600/8.jpg" /></a></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">13. </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Start the Selenium Standalone Server</span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">14. </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Right click on the 'ChapterOneTests' Java Class file and select to Run as 'TestNG' as shown below:</span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZZVh0sAnAhHrmbCR3bmSpCP6jCfvLV44HKkvgTMl6sunE7Vy4eB4A_VRs3ScieIoHFh7sYm0Zbi6_CZCYtfOIfslW02w5_1kk8RPqQhknJ14zsWz9yzW-vlTk9-58dysX0e-W_-do1b4N/s1600/9.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="474" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZZVh0sAnAhHrmbCR3bmSpCP6jCfvLV44HKkvgTMl6sunE7Vy4eB4A_VRs3ScieIoHFh7sYm0Zbi6_CZCYtfOIfslW02w5_1kk8RPqQhknJ14zsWz9yzW-vlTk9-58dysX0e-W_-do1b4N/s640/9.jpg" width="640" /></a></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">15. Ensure that our tests in </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">'ChapterOneTests' Java Class file got passed as shown below:</span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYXvofCfC30GMurrfctYADVUx0RT71GdD8YDyIlj5NwWSE-TmWvGvGD3WZPS8LY0FFrsUVOvlom0ypXxbdLMYnc-LczSlWFLAkKQOhLwIuYxMut72aYp8C6UJQTF182Qrs1bJfrgWPnbZs/s1600/10.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYXvofCfC30GMurrfctYADVUx0RT71GdD8YDyIlj5NwWSE-TmWvGvGD3WZPS8LY0FFrsUVOvlom0ypXxbdLMYnc-LczSlWFLAkKQOhLwIuYxMut72aYp8C6UJQTF182Qrs1bJfrgWPnbZs/s1600/10.jpg" /></a></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">16. </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Right click on the 'ChapterTwoTests' Java Class file and select to Run as 'TestNG' as shown below:</span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqH6gMYZc9SfQk5TRaY6AoGtQ0i4Fh9pmgL9ijEoBikq7OXSuOo5qi3aKOi404oJH1bXnNri0yq63SG8uDh-n4IFkqPoTDtWXZ4xycmCSbbDoPpP80y94e55ubmGd4G4HVfC86UB7hNIu2/s1600/11.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="500" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqH6gMYZc9SfQk5TRaY6AoGtQ0i4Fh9pmgL9ijEoBikq7OXSuOo5qi3aKOi404oJH1bXnNri0yq63SG8uDh-n4IFkqPoTDtWXZ4xycmCSbbDoPpP80y94e55ubmGd4G4HVfC86UB7hNIu2/s640/11.jpg" width="640" /></a></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">17. Ensure that our tests in </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">'ChapterTwoTests' Java Class file got passed as shown below:</span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrpYOd94kDHb9q32sfVWOTSv9moBX1dO34sNBPyeo_3_myPgpaT9FcDsHS2iaDSxEpzmhQbctqVPW1u2uIWG60GC-qAZipUrxPqMVh_wxpYa0hui3K2ZXJZ-jzOaB68vbakqN5IJDKWo40/s1600/12.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrpYOd94kDHb9q32sfVWOTSv9moBX1dO34sNBPyeo_3_myPgpaT9FcDsHS2iaDSxEpzmhQbctqVPW1u2uIWG60GC-qAZipUrxPqMVh_wxpYa0hui3K2ZXJZ-jzOaB68vbakqN5IJDKWo40/s1600/12.jpg" /></a></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">18. </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Right click on the 'ChapterThreeTests' Java Class file and select to Run as 'TestNG' as shown below:</span></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi91n1dIEr1XQDlhySZrBSGzlX_RBsX2Dst4rC0JGcXlqNJ0ahCtlHk9Dhh3mdTuSDoG4MUdg_bVPRxPTpgu17rC_VkRnNr5SUx6yZMvMkZVh_2IZ5mTpagrXAi8xqMtf3rpP6eiGnuz2Dn/s1600/13.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="464" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi91n1dIEr1XQDlhySZrBSGzlX_RBsX2Dst4rC0JGcXlqNJ0ahCtlHk9Dhh3mdTuSDoG4MUdg_bVPRxPTpgu17rC_VkRnNr5SUx6yZMvMkZVh_2IZ5mTpagrXAi8xqMtf3rpP6eiGnuz2Dn/s640/13.jpg" width="640" /></a></div>
<div>
<br /></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">17. Ensure that our tests in </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">'ChapterThreeTests' Java Class file got passed as shown below:</span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYx0g6ObTnXsfaRQ0VpoeYPS7leOjAfSqYBD0R607GmA94w4zl-LewzfSqEWx-h-ylU-C0s3EpOuATUQy7p8cSjG1EuP-wm_TzeWsWNW5iuNJVXdwQSSK9-3Essd78ryW5A-IyMnWJrtJF/s1600/14.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYx0g6ObTnXsfaRQ0VpoeYPS7leOjAfSqYBD0R607GmA94w4zl-LewzfSqEWx-h-ylU-C0s3EpOuATUQy7p8cSjG1EuP-wm_TzeWsWNW5iuNJVXdwQSSK9-3Essd78ryW5A-IyMnWJrtJF/s1600/14.jpg" /></a></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Now lets create a testng.xml configuration XML file for batch running all the tests in the Java Class files </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> '</span><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">ChapterOneTests</span></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">', '</span><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">ChapterTwoTests</span></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">' and '</span><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">ChapterThreeTests</span></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">' by following the below steps:</span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">1. Right click on your computer and select 'New' -> 'Text document' option as shown below:</span></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgredQQhbbH5h2F5jvpBzU6pz5Ravs0eXdmK2Dg4qK7Fe4W8fkBt6ycj2cG4rUR_vjknl3ye3h-fCNOW8znh_H2O7Dph6OAbYi1AsapNAitODSvdUfmuFP3DG6jMs-KVF4iFw6nROKcQPD2/s1600/15.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="391" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgredQQhbbH5h2F5jvpBzU6pz5Ravs0eXdmK2Dg4qK7Fe4W8fkBt6ycj2cG4rUR_vjknl3ye3h-fCNOW8znh_H2O7Dph6OAbYi1AsapNAitODSvdUfmuFP3DG6jMs-KVF4iFw6nROKcQPD2/s400/15.jpg" width="400" /></a></div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">2. Open the created Text Document as shown below:</span></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7XEmnFC5_3xc5NGXXg5HUil3J8SfUB9v1RX0Dg-24pCwBGo71Pkt_LXkXbTfsaQz-mInMZ9FvXKYuvCJtJP1xIMCag1NdT_-HgAD0nEDth9CnMx__xpqsUK7RXOkoUdBcVOlDZM1ZH3B9/s1600/16.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="289" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7XEmnFC5_3xc5NGXXg5HUil3J8SfUB9v1RX0Dg-24pCwBGo71Pkt_LXkXbTfsaQz-mInMZ9FvXKYuvCJtJP1xIMCag1NdT_-HgAD0nEDth9CnMx__xpqsUK7RXOkoUdBcVOlDZM1ZH3B9/s320/16.jpg" width="320" /></a></div>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">3. Open </span></span><a href="http://testng.org/doc/documentation-main.html#testng-xml" target="_blank">http://testng.org/doc/documentation-main.html#testng-xml</a> page and copy the code as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1GW2FJr-9Cx2jamp_TobmFEeSJZUzX25_EYgZnrlYCxFhoMw0pgAI7ykJT6wsjD3e-2nzyHxmnR6PmOIMvNlP1zoOfntl0UfQTqoPOufjCH1iqPyycGgIUG-164tYVMeeqFuX10ZkSH3Q/s1600/17.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1GW2FJr-9Cx2jamp_TobmFEeSJZUzX25_EYgZnrlYCxFhoMw0pgAI7ykJT6wsjD3e-2nzyHxmnR6PmOIMvNlP1zoOfntl0UfQTqoPOufjCH1iqPyycGgIUG-164tYVMeeqFuX10ZkSH3Q/s1600/17.jpg" /></a></div>
<br />
4. Paste the copied code into the Text Document opened in step 2 as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_3lNjF8zpy-PZgRrJNfzVbmu8xHOz5i1ywAxlPKuzLD3TmkHHUsEFxDUbYXDlKXwuTu6sfOEv0k8P2_3xbayn1IkViIiVU_adT_hgcGkfBTzxBt5dn67KoedDKNgWdbS6lrRgQT9MMN0-/s1600/18.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_3lNjF8zpy-PZgRrJNfzVbmu8xHOz5i1ywAxlPKuzLD3TmkHHUsEFxDUbYXDlKXwuTu6sfOEv0k8P2_3xbayn1IkViIiVU_adT_hgcGkfBTzxBt5dn67KoedDKNgWdbS6lrRgQT9MMN0-/s1600/18.jpg" /></a></div>
<br />
5. Change the suite name to 'TheAutomatedTester' for now as shown below: (You can give any suite name based on the context you are running your tests)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrIKvsy-9u0LJam_XUZS2Wvj__4rHbJPbRl4O0ftEzvQ4ltzsyWolBGFvB9fyPc0WlhqXajBrdJI0H5uYtodC8LJW64zjICZzQ8x8VITXIROcZ6vsnPodNnYzSMzgNyneOrYi1s-fuN6_f/s1600/19.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrIKvsy-9u0LJam_XUZS2Wvj__4rHbJPbRl4O0ftEzvQ4ltzsyWolBGFvB9fyPc0WlhqXajBrdJI0H5uYtodC8LJW64zjICZzQ8x8VITXIROcZ6vsnPodNnYzSMzgNyneOrYi1s-fuN6_f/s1600/19.jpg" /></a></div>
<br />
6. As we have three Java class files in our Project, suppose you want to execute 2 Java class files as one test and another Java class files as another test. Make sure that you have two <test> tags, i.e. one test tag with only one class file and the another with two class files as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_WT-O2nSmJpdce4OuQngw7Pxb46MNho_iAYrz-Hlk0R1mJGtTj008mc1oskiw2Nmcg0birHpkCcdREBI3SSTcx7llGn_ZsRkeZ8vK2LRONtp5bD_TWNvRsafG-WmEyS_UPlmedMe1XIAE/s1600/21.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_WT-O2nSmJpdce4OuQngw7Pxb46MNho_iAYrz-Hlk0R1mJGtTj008mc1oskiw2Nmcg0birHpkCcdREBI3SSTcx7llGn_ZsRkeZ8vK2LRONtp5bD_TWNvRsafG-WmEyS_UPlmedMe1XIAE/s1600/21.jpg" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
7. Change the test names to 'TestOne' and 'TestTwo' as shown below: ( Assume that the TestOne and TestTwo are Test Categories under which you have categorized your tests. You can categorize your tests according to your application functionality or you can distribute the number of class files across the Test Categories. Its your wish :) )<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicyfXl92mLpUfXWoMldPyJVGNKYSlBgRoHucWOXzrapCG7aj5500INgtAyDyaBc5iEj6KUcagyFi9T2runXZoUCN8qSVCQQXjhxFMoKyXGZCkqydOEldeSV55bRxdtNH0lDgSpIYwLpq5V/s1600/22.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicyfXl92mLpUfXWoMldPyJVGNKYSlBgRoHucWOXzrapCG7aj5500INgtAyDyaBc5iEj6KUcagyFi9T2runXZoUCN8qSVCQQXjhxFMoKyXGZCkqydOEldeSV55bRxdtNH0lDgSpIYwLpq5V/s1600/22.jpg" /></a></div>
<br />
<br />
8. Now change the class name of the first <class> tag by providing the <b>parent</b>package<b>name</b>.<b>sub</b>package<b>name</b>.<b>class</b>file<b>name</b>. In our case we don't have sub package, hence it will be <b>package</b>name.<b>class</b>file<b>name</b>. Hence we have to change the class name of first <class> tag in testng.xml configuration file to <b style="color: #990000;">package67.ChapterOneTests </b>as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPXhfkU2scqnJEuEL8hxKBwetfxPkOPcRsO7Flcj8xLZZUDGLWmfWCsbsVa8MXJ1eFdongJxe1Ixqy_Spo4ooGIiCe-3TQBj1c8mj6f_-oJst1a_qb06Qkscg9blfJONN7eC22xlkxNw69/s1600/23.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPXhfkU2scqnJEuEL8hxKBwetfxPkOPcRsO7Flcj8xLZZUDGLWmfWCsbsVa8MXJ1eFdongJxe1Ixqy_Spo4ooGIiCe-3TQBj1c8mj6f_-oJst1a_qb06Qkscg9blfJONN7eC22xlkxNw69/s1600/23.jpg" /></a></div>
<br />
9. In the similar way, change the class names of remaining two <class> tags as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1qe2w6JvP-hH5KwnMhbjuFo3vPvsHEkEIbKwyQJSlzZkLVTY9QjPwQjbUDYszp7sb8BCOnrgdTxQJAdxy5GIGoQfw61x8Uauz-YmBazmdbYkNku8y5sYoxpq8fjZ10Qf4VH5FjUWrLqKK/s1600/24.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1qe2w6JvP-hH5KwnMhbjuFo3vPvsHEkEIbKwyQJSlzZkLVTY9QjPwQjbUDYszp7sb8BCOnrgdTxQJAdxy5GIGoQfw61x8Uauz-YmBazmdbYkNku8y5sYoxpq8fjZ10Qf4VH5FjUWrLqKK/s1600/24.jpg" /></a></div>
<br />
10. Click on 'File' menu and select 'Save As' option as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvUQ_8f-uhcItCaokxToXK-hP6Frv4007ixYHEbQThhB08j6BkTR9V6bvZkyZwyc4_Ud92lJRKaHk04IVHqLRUwUVRBMfwUUTvPQmdM_q6mTMX5Xp4rKtSSIGnugHfTCEkK6exDDp66-JD/s1600/25.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvUQ_8f-uhcItCaokxToXK-hP6Frv4007ixYHEbQThhB08j6BkTR9V6bvZkyZwyc4_Ud92lJRKaHk04IVHqLRUwUVRBMfwUUTvPQmdM_q6mTMX5Xp4rKtSSIGnugHfTCEkK6exDDp66-JD/s1600/25.jpg" /></a></div>
<br />
11. Ensure that the Save As dialog is displayed as shown below and give the <b>File Name</b> as <b>testng.xml</b> and <b>Save as type</b> field value as <b>All Files </b>and click on 'Save' Button<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSpJQiYmeTi25xNqQE8c5xDd8oNT7bDjnWJv3JKNLirtoHzgHfKy1OSOFk4aadrzaPi4EJjk4YPzD7CMW2obTwP550_aTbpgDDXNmjCqHDBvkaJKSXKglSB0NHk4zSl9XpjCdmayq2Vy1T/s1600/26.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSpJQiYmeTi25xNqQE8c5xDd8oNT7bDjnWJv3JKNLirtoHzgHfKy1OSOFk4aadrzaPi4EJjk4YPzD7CMW2obTwP550_aTbpgDDXNmjCqHDBvkaJKSXKglSB0NHk4zSl9XpjCdmayq2Vy1T/s1600/26.jpg" /></a></div>
<br />
12. Ensure that <b>testng.xml</b> file got created on your computer as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTCwmVi2ULGyM7gJ34G-cS8hdbowIWt69eDpvWLkLnsuEf1m_Y2fSy7b0Cph6A64g5IekpZbSX5odsUjXT0OZEvbEVl7oDg7Vdgr8mCFXy-yd1JBXDjigQzCeYaB1wlUgP_TIVv1Gz3aLP/s1600/27.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTCwmVi2ULGyM7gJ34G-cS8hdbowIWt69eDpvWLkLnsuEf1m_Y2fSy7b0Cph6A64g5IekpZbSX5odsUjXT0OZEvbEVl7oDg7Vdgr8mCFXy-yd1JBXDjigQzCeYaB1wlUgP_TIVv1Gz3aLP/s1600/27.jpg" /></a></div>
<br />
13. In Eclipse IDE, create a folder 'Config' as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWtjK-g9pUHRMJhuQLdxswcC8b3Fvbc8FGqGe6K1RLmDg8upPuFkd4QIO_6iiRO5yC796RpzyQ0PJ28MZTfe9qfkgBuUlsqudNGhIQa5DnDoemFcHvm_Uoh4x3ve6O_SD-_-BFqZePZxps/s1600/29.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWtjK-g9pUHRMJhuQLdxswcC8b3Fvbc8FGqGe6K1RLmDg8upPuFkd4QIO_6iiRO5yC796RpzyQ0PJ28MZTfe9qfkgBuUlsqudNGhIQa5DnDoemFcHvm_Uoh4x3ve6O_SD-_-BFqZePZxps/s1600/29.jpg" /></a></div>
<br />
14. Copy the <b>testng.xml</b> file on your computer as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3ub7o3NQ3Jg0TTOTfZ-lcL6vGXxgg9srgE5tXEFPOaS87hdRPTuCUhOnN-MC7ihyTkwl0Y9RBjMgqFpc3Yk2qefMhqmv8UcryKrZKx86_nlW5RS0-Ch2fT78MKl_6EzdLbhLMSwIGBVHW/s1600/30.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3ub7o3NQ3Jg0TTOTfZ-lcL6vGXxgg9srgE5tXEFPOaS87hdRPTuCUhOnN-MC7ihyTkwl0Y9RBjMgqFpc3Yk2qefMhqmv8UcryKrZKx86_nlW5RS0-Ch2fT78MKl_6EzdLbhLMSwIGBVHW/s320/30.jpg" width="269" /></a></div>
<br />
15. Paste the copied <b>testng.xml </b>file into the <b>Config</b> folder in <b>Eclipse IDE</b> as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimE6vUi1CMRbTm8TS-ta7ecNurVI2jD3UapV2pWyKYOL3GFi-Rb1NHW6FEPfbBiPaSa23gRWVk6fXzANDObU5nRZNrgg_h6bk-tVWKZJ38pGo3C4l2qxsxHOCmcBhB-eDsPkrAjyoIuNDa/s1600/31.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="296" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimE6vUi1CMRbTm8TS-ta7ecNurVI2jD3UapV2pWyKYOL3GFi-Rb1NHW6FEPfbBiPaSa23gRWVk6fXzANDObU5nRZNrgg_h6bk-tVWKZJ38pGo3C4l2qxsxHOCmcBhB-eDsPkrAjyoIuNDa/s400/31.jpg" width="400" /></a></div>
<br />
16. Ensure that the <b>testng.xml</b> file got copied into the Config folder as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyOLtWq0lBuMvC4xJLmGsOm5Ig7iPkRU7eLhVU1n2Jb9-sT6i8xGrDn9ZWCcL9tF9js_XVxUraB4UztOLwi8L-kwlHUr8e_nshXsUvOMyKD0nxeHgGQv6cjXeDmU2O1C7j_tDutGSEITpe/s1600/32.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyOLtWq0lBuMvC4xJLmGsOm5Ig7iPkRU7eLhVU1n2Jb9-sT6i8xGrDn9ZWCcL9tF9js_XVxUraB4UztOLwi8L-kwlHUr8e_nshXsUvOMyKD0nxeHgGQv6cjXeDmU2O1C7j_tDutGSEITpe/s1600/32.jpg" /></a></div>
<br />
<br />
Now lets run the <b>testng.xml</b> configuration file using TestNG, in order to run all the Java Class files that we have mentioned in the files by following the below steps:<br />
<br />
1. Start the Selenium Standalone Server<br />
2. Right click on the <b>testng.xml</b> file and select to Run as '<b>TestNG Suite</b>' as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZkjaEFtTmAPkxoUhjbkAodqZZBji7AFlsEEw44sBbzmGbpwSkErc6IDkg8QNr7xFwiRPWy05E1lvmwnTbTyYRAU5RJ_ff_SRhDlmcNtvD7Un6vfoNzceLfnd3eBgdz7P5m1KhGccb2QvB/s1600/33.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="512" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZkjaEFtTmAPkxoUhjbkAodqZZBji7AFlsEEw44sBbzmGbpwSkErc6IDkg8QNr7xFwiRPWy05E1lvmwnTbTyYRAU5RJ_ff_SRhDlmcNtvD7Un6vfoNzceLfnd3eBgdz7P5m1KhGccb2QvB/s640/33.jpg" width="640" /></a></div>
<br />
<br />
3. Observe that all the Test methods inside the Java Class files which we have specified in the <b>testng.xml </b>config file got passed as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvPkBbGikwiiFGN5uWT1yxmbsms1lKpRR6yFTU2UvUsCnawG7uvhgaM_8qPD609xyLRRRtk-reXM3flZEiCuTJnuwrN4OLKzegivzWX4mkSczKFvWNHCeHW3mcs0TpVUgUD_uqOmE-VKLc/s1600/34.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvPkBbGikwiiFGN5uWT1yxmbsms1lKpRR6yFTU2UvUsCnawG7uvhgaM_8qPD609xyLRRRtk-reXM3flZEiCuTJnuwrN4OLKzegivzWX4mkSczKFvWNHCeHW3mcs0TpVUgUD_uqOmE-VKLc/s1600/34.jpg" /></a></div>
<br />
<br />
4. Observe that 'test-output' folder is not displayed in the Project as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEih6FC8FxnLaSsTjIHxgagcdMYKMdmj10FvjX8Xn6mdAPRctDYh9xCmWoPpoDYXGFac3t5XBLR8Tl4FW4AHGL-YPsogKwToshMYUJNzUTY7Z8p53CRg65XcxBnY0zzshO9_1ewJAflDsJT7/s1600/35.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEih6FC8FxnLaSsTjIHxgagcdMYKMdmj10FvjX8Xn6mdAPRctDYh9xCmWoPpoDYXGFac3t5XBLR8Tl4FW4AHGL-YPsogKwToshMYUJNzUTY7Z8p53CRg65XcxBnY0zzshO9_1ewJAflDsJT7/s400/35.jpg" width="345" /></a></div>
<br />
5. Right click on the Project and select 'Refresh' option to refresh the project as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQQ74tZaJwzDfhaDbPxaBNBZLHr4QhJAId06jl2wEIm-dNjiBhEiZ9ihXer82j3P9ma7-Eyqq2d3ZB2Yp5C78fKmAhpopqsHvIqWJQyQYAvOU3c1dv8U_UP7K_V1hZXlbUDhpGk2PhD0PO/s1600/36.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="365" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQQ74tZaJwzDfhaDbPxaBNBZLHr4QhJAId06jl2wEIm-dNjiBhEiZ9ihXer82j3P9ma7-Eyqq2d3ZB2Yp5C78fKmAhpopqsHvIqWJQyQYAvOU3c1dv8U_UP7K_V1hZXlbUDhpGk2PhD0PO/s400/36.jpg" width="400" /></a></div>
<br />
<br />
6. On Refresh, observe that the 'test-output' folder is displayed as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjkQJkWJ8v5ZZuh5GtsHC8_EhRDS0sR7PurTtbgxMxy5yxLJqyK4zHKJK8XJtxWgs6RVTxlch95RHouNGnw__o8iWeUFA_XL6898mM5kCFrxIB964bkjk2-xm4oBA8mIwdOuB1H-Ugk54v/s1600/37.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjkQJkWJ8v5ZZuh5GtsHC8_EhRDS0sR7PurTtbgxMxy5yxLJqyK4zHKJK8XJtxWgs6RVTxlch95RHouNGnw__o8iWeUFA_XL6898mM5kCFrxIB964bkjk2-xm4oBA8mIwdOuB1H-Ugk54v/s1600/37.jpg" /></a></div>
<br />
7. Expand the 'test-output' folder and ensure that 'index.html' file is displayed as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgX64VYggH6gf6BNF8S5pJQHeYJA_ktHVD3VgSsC-AtvPVxnfMzBqo-N6GKLzcmo6IM28-NhARJZ9fcavNqeGDWpBUFC288eAPRNM_yoFOYHm4T0fsdXfHlCVztccPwhrBwxzWhO2bW1sc/s1600/38.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgX64VYggH6gf6BNF8S5pJQHeYJA_ktHVD3VgSsC-AtvPVxnfMzBqo-N6GKLzcmo6IM28-NhARJZ9fcavNqeGDWpBUFC288eAPRNM_yoFOYHm4T0fsdXfHlCVztccPwhrBwxzWhO2bW1sc/s1600/38.jpg" /></a></div>
<br />
8. Right click on the 'index.html' file and select to open with web browser as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyE8ZV3-IZQX_cFI7xnwzL-7PJ6Llf5IMdaaj4AEXqJ2ruhZqPXnBRnIR-klYb6KliCe678emwdK_YBr7ZqGAroZ5dHxwKfj3sW3i8sZcxRKTIPyBQ4pslJmtT81lpMZGaF0J3_79BarLT/s1600/39.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyE8ZV3-IZQX_cFI7xnwzL-7PJ6Llf5IMdaaj4AEXqJ2ruhZqPXnBRnIR-klYb6KliCe678emwdK_YBr7ZqGAroZ5dHxwKfj3sW3i8sZcxRKTIPyBQ4pslJmtT81lpMZGaF0J3_79BarLT/s1600/39.jpg" /></a></div>
<br />
<br />
9. Observe that the TestNG test results graphical report is displayed as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi9pYb6dzz2ge-MB4vlj1CYZ5KGjf6THx-Y4FOUD8IR5Q7TCS8Cn-mZNrR6-R99JfgiNes1hAs07N_-Ne3FYVObATnMIu3Dz_WJri8nb49TxasW34ri9a1weMbuG0DkquHasxBvmD9GjmQ/s1600/40.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="267" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi9pYb6dzz2ge-MB4vlj1CYZ5KGjf6THx-Y4FOUD8IR5Q7TCS8Cn-mZNrR6-R99JfgiNes1hAs07N_-Ne3FYVObATnMIu3Dz_WJri8nb49TxasW34ri9a1weMbuG0DkquHasxBvmD9GjmQ/s640/40.jpg" width="640" /></a></div>
<br />
Observe that this report is not as per our needs. We have to customize this report by editing its html code and generate a report that meets our needs. How to customize this report will be explained when the time comes.<br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Watch the Below Video:</span></b><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><a href="http://www.youtube.com/watch?v=ytmMTBU74ik&feature=youtu.be" target="_blank">Click Here</a></b> to watch the Video</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Download this Project:</span></b><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFQ3ubkmtpiVh9v97qwmRH6Uwyj3F52qlsd57w2zg5S3YCzP80tNIRcOEpTGGcGmDn_GxCbH-PQ_mrVAi28JEA8KeWTLXwUWio3oYD08uNbCVFFHikpnHz2aHPGqJlUq9HWRzZhOhEO0_C/s1600/next5.jpg" imageanchor="1" style="background-color: white; clear: right; color: #771100; float: right; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; margin-left: 1em; text-align: center; text-decoration: none;"><br /></a><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i><a href="http://www.mediafire.com/?evdhdh9b99vklrr" target="_blank">Click here</a></i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to download this project and import into Eclipse IDE on your machine.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b><span style="background-color: white; color: #38761d; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><i><u>Understanding the usage of verbose attribute in testng configuration file</u></i> will be explained in the next post.</b></span><br />
<span style="background-color: white; color: #38761d; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><br /></b></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5b_PTso9MKo0oOmnCRrCec5boSXc_U4WgkzB4lTBeFCCs0KS2a6439XpBnaMDVFYcSNBgoP7qeroN-z10ad3FLxNhJ_EZjiIW2D-uRFj6XgmrD_WLIZSII7o0uSVSjunqlMIwYIvWeScV/s1600/next5.jpg" imageanchor="1" style="clear: right; color: #cc4411; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5b_PTso9MKo0oOmnCRrCec5boSXc_U4WgkzB4lTBeFCCs0KS2a6439XpBnaMDVFYcSNBgoP7qeroN-z10ad3FLxNhJ_EZjiIW2D-uRFj6XgmrD_WLIZSII7o0uSVSjunqlMIwYIvWeScV/s1600/next5.jpg" style="border: none; position: relative;" /></a></div>
</div>
Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com5tag:blogger.com,1999:blog-2483593764182960323.post-2336200213803210302013-05-19T23:30:00.000-07:002013-05-20T08:03:38.114-07:00156. Using @BeforeClass and @AfterClass TestNG Annotations<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-hyP5LZQZpci31JaiwledJDoDAcpuxnfQ5mOW3_teaeYSf1QdBCRnxRzWpuUrtNAkmG31Gltd4zwaN0A4TSUFakek5R_zcbrWPCtBcWWsVXSF5vbyaAjDkgSqSn9uOZpQtK3J7oUzbiJS/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-hyP5LZQZpci31JaiwledJDoDAcpuxnfQ5mOW3_teaeYSf1QdBCRnxRzWpuUrtNAkmG31Gltd4zwaN0A4TSUFakek5R_zcbrWPCtBcWWsVXSF5vbyaAjDkgSqSn9uOZpQtK3J7oUzbiJS/s1600/PreviousPost2.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">As we've already discussed the advantage of @BeforeClass over the @BeforeMethod TestNG Annotation and also the advantage of @AfterClass over the @AfterMethod TestNG annotation in our previous post. Lets implement the @BeforeClass and @AfterClass TestNG annotations.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">As part of Refactoring the Selenium Automation Code we've to use @BeforeClass and @AfterClass TestNG annotations instead of @BeforeMethod and @AfterMethod TestNG annotation.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Lets Implement This: (i.e. Implementing </span><span style="color: #cc0000;">@BeforeClass</span><span style="color: blue;"> and </span><span style="color: #cc0000;">@AfterClass</span><span style="color: blue;"> TestNG annotations)</span></b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;"><br /></span></b>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Lets view the code containing the @BeforeMethod and @AfterMethod TestNG annotations as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEju9dX7YUaj5OkyOhVWMS9GW9FD1YZOQLQmjKWDMpMidET82DJwu8dQ8uvJsYYpfPuYznwukvA1msRRsDKFfmj2onCCEuEz1TkUcDy4ErRiGSIZ7kDMNur7F0c-TvJ9czT0qktQvJ5sd0oK/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEju9dX7YUaj5OkyOhVWMS9GW9FD1YZOQLQmjKWDMpMidET82DJwu8dQ8uvJsYYpfPuYznwukvA1msRRsDKFfmj2onCCEuEz1TkUcDy4ErRiGSIZ7kDMNur7F0c-TvJ9czT0qktQvJ5sd0oK/s1600/1.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Replace the @BeforeMethod TestNG annotation with @BeforeClass TestNG annotation as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsqt2LMr6ggiisJALZp9BhOGDXQ3P7nW0gmUcVxEzKgJB_vFVM8-GDmRvpRBc0yVFjDCqHXo288HnWhUEDZDSOb0dsricWqjnHLUC48hzDmpzt2DQkAKgx12kiMgHDGVHmlHpPipijKcNG/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsqt2LMr6ggiisJALZp9BhOGDXQ3P7nW0gmUcVxEzKgJB_vFVM8-GDmRvpRBc0yVFjDCqHXo288HnWhUEDZDSOb0dsricWqjnHLUC48hzDmpzt2DQkAKgx12kiMgHDGVHmlHpPipijKcNG/s1600/2.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. Replace the @AfterMethod TestNG annotation with @AfterClass TestNG annotation as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHoJXczXf9OSfTWrzg5p_WwHa1Az60Nm-rjGxmpQ1SJf2aArBGw9KODEKxn6vwHGhU3oQTLkWmAAdma68HnTT3pAjJdYqdZI05xg4KzpA1ClGvdJaFYKnZxkOOxbbZqyfa5MP-I0qPE5QO/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHoJXczXf9OSfTWrzg5p_WwHa1Az60Nm-rjGxmpQ1SJf2aArBGw9KODEKxn6vwHGhU3oQTLkWmAAdma68HnTT3pAjJdYqdZI05xg4KzpA1ClGvdJaFYKnZxkOOxbbZqyfa5MP-I0qPE5QO/s1600/3.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Start the Selenium Standalone Server</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Save and Run the 'Class66.java' file by selecting the 'TestNG' option as shown below:</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwZOA7-9uMAd03J3bt6nocGhY3HMjsl1RdbP-RjgIc9rFZnQmhNJqIDKdxjhHaKAJGpZFIEkuiA4387Q7GW6dB8n9H8kEBGf_gUW2C6sfvL1MrFr619ghlNBiKSE8c38R-8sYabrzL3VWZ/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="535" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwZOA7-9uMAd03J3bt6nocGhY3HMjsl1RdbP-RjgIc9rFZnQmhNJqIDKdxjhHaKAJGpZFIEkuiA4387Q7GW6dB8n9H8kEBGf_gUW2C6sfvL1MrFr619ghlNBiKSE8c38R-8sYabrzL3VWZ/s640/4.jpg" width="640" /></a></div>
<br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">6. </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">In this case, Observe that the Firefox Browser has launched only <b>once</b> for performing the above three tests as shown in the below video.</span><br />
<br />
<b><span style="color: blue;">Watch the Below Video:</span></b><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><a href="http://www.youtube.com/watch?v=8K2CGF2be8g&feature=youtu.be" target="_blank">Click Here</a></b> to watch the Video</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Download this Project:</span></b><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFQ3ubkmtpiVh9v97qwmRH6Uwyj3F52qlsd57w2zg5S3YCzP80tNIRcOEpTGGcGmDn_GxCbH-PQ_mrVAi28JEA8KeWTLXwUWio3oYD08uNbCVFFHikpnHz2aHPGqJlUq9HWRzZhOhEO0_C/s1600/next5.jpg" imageanchor="1" style="background-color: white; clear: right; color: #771100; float: right; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; margin-left: 1em; text-align: center; text-decoration: none;"><br /></a><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i><a href="http://www.mediafire.com/?y9vk9yti3zd96ck" target="_blank">Click here</a></i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to download this project and import into Eclipse IDE on your machine.</span><br />
<br />
<br />
<b><span style="color: blue;">Other TestNG annotations:</span></b><br />
<br />
As we have gone through the below basic TestNG annotations:<br />
<br />
1. @Test<br />
2. @BeforeMethod<br />
3. @AfterMethod<br />
4. @BeforeClass<br />
5. @AfterClass<br />
<br />
The below remaining TestNG annotations will be explained when the need arrives:<br />
<br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">6. @BeforeGroups</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">7. @AfterGroups</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">8. @BeforeSuite</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">9. @AfterSuite</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">10. @Parameters</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">11. @DataProvider</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">12. @Factory</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">13. @Listerners</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b><span style="background-color: white; color: #38761d; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><i><u>Creating testing.xml configuration file</u></i> will be explained in the next post.</b></span><br />
<span style="background-color: white; color: #38761d; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><br /></b></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span>
<br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5b_PTso9MKo0oOmnCRrCec5boSXc_U4WgkzB4lTBeFCCs0KS2a6439XpBnaMDVFYcSNBgoP7qeroN-z10ad3FLxNhJ_EZjiIW2D-uRFj6XgmrD_WLIZSII7o0uSVSjunqlMIwYIvWeScV/s1600/next5.jpg" imageanchor="1" style="clear: right; color: #cc4411; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5b_PTso9MKo0oOmnCRrCec5boSXc_U4WgkzB4lTBeFCCs0KS2a6439XpBnaMDVFYcSNBgoP7qeroN-z10ad3FLxNhJ_EZjiIW2D-uRFj6XgmrD_WLIZSII7o0uSVSjunqlMIwYIvWeScV/s1600/next5.jpg" style="border: none; position: relative;" /></a></div>
Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com0tag:blogger.com,1999:blog-2483593764182960323.post-251355106153213152013-05-19T22:40:00.002-07:002013-05-20T07:46:24.895-07:00155. Only one test should be written inside a single test method<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRlHhs6KPVYQl58s7r_mpEX998uXOE6D2sFONFGzSSuyDfCR2UGNrtc_5iNA86eqs4X27mX5ghGNzkwgK7KpKyvX6h_OxxeXpTw6cASGV8JmOTcUl5gffFoK5FEc6pHJd3EfEirqUxHK8G/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRlHhs6KPVYQl58s7r_mpEX998uXOE6D2sFONFGzSSuyDfCR2UGNrtc_5iNA86eqs4X27mX5ghGNzkwgK7KpKyvX6h_OxxeXpTw6cASGV8JmOTcUl5gffFoK5FEc6pHJd3EfEirqUxHK8G/s1600/PreviousPost2.jpg" /></a></div>
<br />
<br />
<br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Before going forward, lets once again view the code we have written in our previous post below: (i.e. The code with more than one tests inside a single test method)</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAy7V_S7du_caiZYY-kFUY4Sgn-gJs0s5X2slv-SZStt_ZBVy-QOT4t_xPgRCNXt8mFN9Qsgr7Nsm1ITMLDYsT0wqApYEfJf2h4nMR5xft92WyvSlCE0R-HflbnjZnxK7vHKFsls8-ilDk/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAy7V_S7du_caiZYY-kFUY4Sgn-gJs0s5X2slv-SZStt_ZBVy-QOT4t_xPgRCNXt8mFN9Qsgr7Nsm1ITMLDYsT0wqApYEfJf2h4nMR5xft92WyvSlCE0R-HflbnjZnxK7vHKFsls8-ilDk/s1600/1.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. As its not a good idea to write more than one tests inside a single test method, lets Refactor the Selenium Automation code by writing all the 3 tests into a separate test methods as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5pqN6qtW6IfDXkeLhviuWrSaZb-_jTMvdnoE3Tsdslcn6heFFsSD-yRqJYqxwi39jTHKkb73pCwoFsJyj38buhfBP0Mrk_Ga5CpSRPDQ1lJyg4Z6pcJ-lz74ZTJH9nl_bG7HOiz81LF9b/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5pqN6qtW6IfDXkeLhviuWrSaZb-_jTMvdnoE3Tsdslcn6heFFsSD-yRqJYqxwi39jTHKkb73pCwoFsJyj38buhfBP0Mrk_Ga5CpSRPDQ1lJyg4Z6pcJ-lz74ZTJH9nl_bG7HOiz81LF9b/s1600/2.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. Start the Selenium Standalone Server</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Save and Run the 'Class66.java' file by selecting the 'JUnit Test' option </span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. In this case, Observe that the Firefox Browser has launched and closed for 3 times instead of once, for performing the above three tests as shown in the below video.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: blue; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b>Watch the Below Video:</b></span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><a href="http://www.youtube.com/watch?v=02RJpUN5wl0&feature=youtu.be" target="_blank">Click Here</a></b> to watch the video.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: blue; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b>Download This Project:</b></span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i><a href="http://www.mediafire.com/?ubnwcjqh79oz6kf" target="_blank">Click here</a></i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to download this project and import into Eclipse IDE on your machine.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b>Why did the firefox launched and closed separately for each test method in the code ?</b></span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">As we've three tests and we've written test method for each of our tests, hence we got 3 test methods in the Selenium Automation code. But in this case 'chapter1' page is common for 3 of the tests and hence its not required to close the application and launch it for performing the remaining tests. This has happened because of @BeforeMethod and @AfterMethod TestNG annotations.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">The code inside the @BeforeMethod and @AfterMethod annotations will be executed once for each test method in our Selenium Automation code. Since we've three test methods in our code, the methods under the @BeforeMethod and @AfterMethod annotations got executed thrice (i.e. once for each test method).</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b>How to resolve this problem ?</b></span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Suppose if we want to run the methods under the @BeforeMethod and @AfterMethod annotations only once, we've to replace these annotations with @BeforeClass and @AfterClass. (i.e. The method under @BeforeClass will be executed before executing all the test methods inside the class and The method under @AfterClass will be executed after executing all the test methods inside the class.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">So to conclude the executing process will be as shown in the below screenshots:</span><br />
<br />
<b style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">@BeforeMethod and @AfterMethod:</b><br />
<b style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNM9tBuxVCfFOchB6mULulP3ii9GyCGFQdBdTalHCw0Q9LurfMNNJYoCwAHUiLQbSABb1OcjT8SrT4CQd0-rbHGCAleGVfd-z4lCnIeZDrPYTcItR-7WtwMEkIJvMK2zl3-bYLAZp7qvyW/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNM9tBuxVCfFOchB6mULulP3ii9GyCGFQdBdTalHCw0Q9LurfMNNJYoCwAHUiLQbSABb1OcjT8SrT4CQd0-rbHGCAleGVfd-z4lCnIeZDrPYTcItR-7WtwMEkIJvMK2zl3-bYLAZp7qvyW/s1600/3.jpg" /></a></div>
<b style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></b>
<b style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">@BeforeClass and @AfterClass:</b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbzSRm9WdchghdZRgLVRcZQ52u9RSbiodrn2W_dPg2F1pJhgdVk63-94JfYKzAIdGIU2IN8V9iXJ2121Q4UQswGmqr_kL5MdGAF5azgZiL2nOvBzlDcArh85GvTkWJ71OF4sSzKY6yFFQ2/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbzSRm9WdchghdZRgLVRcZQ52u9RSbiodrn2W_dPg2F1pJhgdVk63-94JfYKzAIdGIU2IN8V9iXJ2121Q4UQswGmqr_kL5MdGAF5azgZiL2nOvBzlDcArh85GvTkWJ71OF4sSzKY6yFFQ2/s1600/4.jpg" /></a></div>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></b>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">So lets implement the @BeforeClass and @AfterClass TestNG Annotations in the next post.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b><span style="background-color: white; color: #38761d; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><i><u>Using @BeforeClass and @AfterClass TestNG Annotations</u></i> will be explained in the next post.</b></span><br />
<span style="background-color: white; color: #38761d; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><br /></b></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span>
<br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDE6l8rLJYJvqqazKs1RC-yWDor4qMHLj4zdTqXBCJBtvL2NrqgxLHBTZZesEX45oCS2I9lE8Cqy19688szztGDZwgVXSZP8i5oohALzEshqF-vdFhP-9oOaPki7YxzzsdOc96lShmkc8s/s1600/next5.jpg" imageanchor="1" style="clear: right; color: #771100; float: right; margin-bottom: 1em; margin-left: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDE6l8rLJYJvqqazKs1RC-yWDor4qMHLj4zdTqXBCJBtvL2NrqgxLHBTZZesEX45oCS2I9lE8Cqy19688szztGDZwgVXSZP8i5oohALzEshqF-vdFhP-9oOaPki7YxzzsdOc96lShmkc8s/s1600/next5.jpg" style="border: none; position: relative;" /></a></div>
<span style="background-color: white; color: #38761d; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><br /></b></span>Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com0tag:blogger.com,1999:blog-2483593764182960323.post-4738199092120480152013-05-19T22:01:00.000-07:002013-05-20T07:26:22.598-07:00154. Non-Refactored Selenium Automation Code using TestNG framework<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLam5fQsjYQJj-uiDaaV_aA7yE11GRYD-O67HjSkXiSLhzN0szQLCdJ3kVrF2PKF6oDJKPoq_uyFmqIxLXrloJEZUfPPtsxGUcLZ8qmqbNLAMlx6CTdfezZZHdVKNw9BM_NeHMzRB4McVS/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLam5fQsjYQJj-uiDaaV_aA7yE11GRYD-O67HjSkXiSLhzN0szQLCdJ3kVrF2PKF6oDJKPoq_uyFmqIxLXrloJEZUfPPtsxGUcLZ8qmqbNLAMlx6CTdfezZZHdVKNw9BM_NeHMzRB4McVS/s1600/PreviousPost2.jpg" /></a></div>
<br />
<br />
<br />
<br />
<br />
Lets write the Selenium Automation Code without Refactoring it.<br />
Lets make sure that our code contains more than one tests.<br />
Lets include TestNG annotations in our code and later Run using 'TestNG'.<br />
<br />
<b><span style="color: blue;">Test Description:</span></b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOJAJ6XPnZbfl5X7TPx-h_mcC1im-QCkpWxL2IhiMpzZKyL9cQv6i0fhHFZgh175MFu22wSOavR9dcqCocqC9UD1sMSrWnx2VCLxMoz1l7GoXAEX6ldGRyHbPlVqxrgvmy0ZPU8Fu1CLe0/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOJAJ6XPnZbfl5X7TPx-h_mcC1im-QCkpWxL2IhiMpzZKyL9cQv6i0fhHFZgh175MFu22wSOavR9dcqCocqC9UD1sMSrWnx2VCLxMoz1l7GoXAEX6ldGRyHbPlVqxrgvmy0ZPU8Fu1CLe0/s1600/1.jpg" /></a></div>
<br />
<br />
<b><span style="color: blue;">Implement this on Eclipse IDE using TestNG framework:</span></b><br />
<br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Pre-requisites:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Create a new Project say 'RC-Project66' in Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Configure the Project to work with Selenium RC</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. Configure the Selenium Standalone Server to run from Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Start the Selenium Standalone Server</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Create a package say 'package66' under the newly created project.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">6. Create a Java Class file say 'Class66' under the newly created package as shown below:</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDyZIH4qd8xkzJX39-fKkYRrIhxUKqv32nQ1v58Gd85lJ9Tk-nMEEsSeW0-PeoRGuXNT81ymBT4ZbxWeGEqyCFItljElI4IhJp5J82v02flLSpP76KD-xA6Z4rUv9urNp80dx1UyehgGtg/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDyZIH4qd8xkzJX39-fKkYRrIhxUKqv32nQ1v58Gd85lJ9Tk-nMEEsSeW0-PeoRGuXNT81ymBT4ZbxWeGEqyCFItljElI4IhJp5J82v02flLSpP76KD-xA6Z4rUv9urNp80dx1UyehgGtg/s1600/2.jpg" /></a></div>
<br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Actual Steps:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Write the following code into the newly created Java Class file as shown below and make sure that you resolve all the errors before going to next step: (</span><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Write three tests inside a single test method</span></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">)</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhceIX32us6ZTz3fbYFsb107I3FfwLz99OA46bgx7qMs4vm0Ad8hpQ6e1lXNkM615lF_wS80WeLhhfy_iP_LJzWpwlpfK48nQK4l7sUgmP3POCCdqSjF8MhgnYqAiq0nPp0grYEjmhW4uGZ/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhceIX32us6ZTz3fbYFsb107I3FfwLz99OA46bgx7qMs4vm0Ad8hpQ6e1lXNkM615lF_wS80WeLhhfy_iP_LJzWpwlpfK48nQK4l7sUgmP3POCCdqSjF8MhgnYqAiq0nPp0grYEjmhW4uGZ/s1600/3.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Start the Selenium Standalone Server</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. Save and Run the 'Class66.java' file by selecting the 'TestNG' option as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTT4ZfjiIc50rZD53uY2aYGhaLiyRvypjztAA-xRwruOIrD5LBedYVl5wPjnqKl-mMMT_a9JLf5R5oUFMfwJtJVuQUugVHOd0HdHX898om2DaCUz3i0cZr6Fw_TwYBsjwWl5bWnme5y0Ln/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="460" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTT4ZfjiIc50rZD53uY2aYGhaLiyRvypjztAA-xRwruOIrD5LBedYVl5wPjnqKl-mMMT_a9JLf5R5oUFMfwJtJVuQUugVHOd0HdHX898om2DaCUz3i0cZr6Fw_TwYBsjwWl5bWnme5y0Ln/s640/4.jpg" width="640" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Ensure that all the three tests in our Automation code are passed as shown in the below video:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Watch the below video:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<i style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><a href="http://www.youtube.com/watch?v=_fiGeXfYTEU&feature=youtu.be" target="_blank">Click here</a></b></i><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to watch the video.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Download this Project:</span></b><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFQ3ubkmtpiVh9v97qwmRH6Uwyj3F52qlsd57w2zg5S3YCzP80tNIRcOEpTGGcGmDn_GxCbH-PQ_mrVAi28JEA8KeWTLXwUWio3oYD08uNbCVFFHikpnHz2aHPGqJlUq9HWRzZhOhEO0_C/s1600/next5.jpg" imageanchor="1" style="background-color: white; clear: right; color: #771100; float: right; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; margin-left: 1em; text-align: center; text-decoration: none;"><br /></a><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i><a href="http://www.mediafire.com/?ozefkaw7zxo6occ" target="_blank">Click here</a></i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to download this project and import into Eclipse IDE on your machine.</span><br />
<br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<br />
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<b>Is it ok to write three tests in a single Test method instead of writing them in separate test methods?</b></div>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<br /></div>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
The answer is No. Though the Test runs without any errors even if we mention more than one tests in a single test method, its not a good practice to write more than one test into a single test method.</div>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<br /></div>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<b>So what we have to do in order to overcome this ?</b></div>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<br /></div>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
We've to write each and every test into a separate test method.</div>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<br /></div>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<br /></div>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<b><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b></div>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<b><i><u><br /></u></i></b></div>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<span style="color: #38761d;"><b><i><u>Only one test should be written inside a single test method</u> </i></b>will be explained in the next post.</span></div>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<br /></div>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCPJrgK2JEsAX5xJImIcryK8rJn6JhwKNXxiZCZR53QnXUYdrbo2rNi_XuSOqXWvG3bmM-_o1V02G81IHj84FxVamTvXSivQu7zs8X5Xo-r0l5EEMevJI9hwLbjYeztUZDhYgtFA2VTdjH/s1600/next5.jpg" imageanchor="1" style="clear: right; color: #cc4411; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCPJrgK2JEsAX5xJImIcryK8rJn6JhwKNXxiZCZR53QnXUYdrbo2rNi_XuSOqXWvG3bmM-_o1V02G81IHj84FxVamTvXSivQu7zs8X5Xo-r0l5EEMevJI9hwLbjYeztUZDhYgtFA2VTdjH/s1600/next5.jpg" style="border: none; position: relative;" /></a></div>
</div>
Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com0tag:blogger.com,1999:blog-2483593764182960323.post-41854772361838416092013-05-17T08:01:00.000-07:002013-07-08T05:32:02.733-07:00153. Using TestNG Annotations in Selenium RC code<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3MYVCEZD8jjhf3oeJQNdp1H6oVCNebtXDOPxoH-zArgDckrXIQ90sd4Cmvp4VVGEzLwa0j7oWMeNx685mJg_gNP6I4j0UvwwOAhfuZTjV1H9Of_B_vsw_uI2opkEK3fQDVdvukHnaIq8J/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3MYVCEZD8jjhf3oeJQNdp1H6oVCNebtXDOPxoH-zArgDckrXIQ90sd4Cmvp4VVGEzLwa0j7oWMeNx685mJg_gNP6I4j0UvwwOAhfuZTjV1H9Of_B_vsw_uI2opkEK3fQDVdvukHnaIq8J/s1600/PreviousPost2.jpg" /></a></div>
<br />
<br />
<br />
<br />
<br />
Once after the TestNG software is installed, we have to add TestNG annotations to the Selenium Automated Tests in order to Run them using TestNG.<br />
<br />
<b>TestNG Annotations list:</b><br />
<br />
1. @Test<br />
2. @BeforeMethod<br />
3. @AfterMethod<br />
4. @BeforeClass<br />
5. @AfterClass<br />
6. @BeforeGroups<br />
7. @AfterGroups<br />
8. @BeforeSuite<br />
9. @AfterSuite<br />
10. @Parameters<br />
11. @DataProvider<br />
12. @Factory<br />
13. @Listerners<br />
<br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">To start with lets use the following TestNG Annotations in our Selenium RC Tests:</span><br />
<br />
<ul>
<li>@Test</li>
<li>@BeforeMethod</li>
<li>@AfterMethod</li>
</ul>
<div>
<br /></div>
<div>
<div>
<b>@Test</b></div>
<div>
<br /></div>
<div>
Java Method in the Class that is annotated with this annotation will be marked as a test method.</div>
</div>
<div>
<br /></div>
<div>
<b>@BeforeMethod</b></div>
<div>
<br /></div>
<div>
Java Method in the Class that is annotated with this annotation will run before each test method.</div>
<div>
<br /></div>
<div>
<b>@AfterMethod </b></div>
<div>
<br /></div>
<div>
Java Method in the Class that is annotated with this annotation will run after each test method.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>Implement the <span style="color: #cc0000;">@Test</span> , <span style="color: #cc0000;">@BeforeMethod</span> and <span style="color: #cc0000;">@AfterMethod</span> annotations in Eclipse IDE by following the below steps:</b></div>
<div>
<b><br /></b></div>
<div>
<b><span style="color: blue;">Test Description:</span></b></div>
<div>
<b><br /></b></div>
<div>
Please go through the comments on the below screenshot to understand the test description.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvLz_rrw2QOaHCCnG0cvXdXM5qX3I1aMm_feBzMLPuiziEGhK6BDJ4CMt-WJ_EK0F_ixLmUgwwx8Sit0v6sLMarRo-lk8-i-U9BKA2wcIi0re8oXUypTth2LcHfU5jIkZH5OOGb_s7HZ3z/s1600/0.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvLz_rrw2QOaHCCnG0cvXdXM5qX3I1aMm_feBzMLPuiziEGhK6BDJ4CMt-WJ_EK0F_ixLmUgwwx8Sit0v6sLMarRo-lk8-i-U9BKA2wcIi0re8oXUypTth2LcHfU5jIkZH5OOGb_s7HZ3z/s1600/0.jpg" /></a></div>
<div>
<br /></div>
<div>
<br />
<b><span style="color: blue;">Importing TestNG Annotations:</span></b><br />
<br />
Please follow the below steps for importing the TestNG annotations:<br />
<br />
1. After specify TestNG Annotation before a method, observe that the TestNG has thrown an error as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOc4ZjUEdhl1h1qdggJVKQ758Nsjb-bNvBJBKlsbcOvN3Vv8xUmScWIINGZlAGLBjQTOqdRFu_N73fIszaJZjz02q6aBRH7Nz52rgorOthCjsYmdgX76mEMcP5Ujo4mfPu34ZlG1rqj17S/s1600/8.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOc4ZjUEdhl1h1qdggJVKQ758Nsjb-bNvBJBKlsbcOvN3Vv8xUmScWIINGZlAGLBjQTOqdRFu_N73fIszaJZjz02q6aBRH7Nz52rgorOthCjsYmdgX76mEMcP5Ujo4mfPu34ZlG1rqj17S/s1600/8.jpg" /></a></div>
<br />
2. Hover your mouse cursor over the error text and import the BeforeClass annotation from TestNG class instead of from JUnit class as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTMzzEBBceLpEjNshi-so5i3cMT0ZvlRMTiDuiQM3gzm84XNp0EH7bbs8COUfgX0irHaQtinVWS_BQNbyeQ7Om22tAy925gaEZw4mkZUzWCf6D3UqBhkKH2r4ukXdso3_9OEglAO2zXf5w/s1600/9.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTMzzEBBceLpEjNshi-so5i3cMT0ZvlRMTiDuiQM3gzm84XNp0EH7bbs8COUfgX0irHaQtinVWS_BQNbyeQ7Om22tAy925gaEZw4mkZUzWCf6D3UqBhkKH2r4ukXdso3_9OEglAO2zXf5w/s1600/9.jpg" /></a></div>
<br />
3. Ensure that the following import statement got added as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3G18N5pDsmVEsYThdmjX7Nxg-Vdtg11xJIB_xIsqCt6Tw4AvTSrKSZRp0jB9_VBXlU36a2u6tS44Piam59ST2wmvP_RFmy4pHhvRGpG8ZsfZ-vrkQupru7XmX6WG19DYMMRAnyBWvsFpy/s1600/10.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3G18N5pDsmVEsYThdmjX7Nxg-Vdtg11xJIB_xIsqCt6Tw4AvTSrKSZRp0jB9_VBXlU36a2u6tS44Piam59ST2wmvP_RFmy4pHhvRGpG8ZsfZ-vrkQupru7XmX6WG19DYMMRAnyBWvsFpy/s1600/10.jpg" /></a></div>
<br />
<br /></div>
<div>
<b style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Pre-requisites:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Create a new Project say 'RC-Project65' in Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Configure the Project to work with Selenium RC</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. Configure the Selenium Standalone Server to run from Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Create a package say 'package65' under the newly created project.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Create a Java Class file say 'Class65' under the newly created package as shown below:</span></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgMjBuWRJPa0dV4bm6RsLtg2aHo9a_yUmN2Kwm4M22vbXGa-8zwcfQ_ISIdFuHHcy7fvj9Tk10-7ZZYkpNi5uuyoeU8MGFpLzxXzoZz4DRbdYEM7IPV4Z6QHK94SrEHHNB4_w7QM9dg4Zs/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgMjBuWRJPa0dV4bm6RsLtg2aHo9a_yUmN2Kwm4M22vbXGa-8zwcfQ_ISIdFuHHcy7fvj9Tk10-7ZZYkpNi5uuyoeU8MGFpLzxXzoZz4DRbdYEM7IPV4Z6QHK94SrEHHNB4_w7QM9dg4Zs/s1600/1.jpg" /></a></div>
<div>
<br /></div>
<div>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b></div>
<div>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Actual Steps:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Lets write the code containing TestNG annotations @BeforeMethod , @Test, @AfterMethod as shown below:</span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFFtbteAS90dUGYgHC1WU8jEhrXLjb1g6NJ2NBBL-sPBrDbUsXDqaMVQb07P68nmd6Ya7pz09i8ZlvcohgOvco8VVWXFmfy6T97Z6mqMvEb2c-hHGVrSmQepCVuL2s57SsojKlMkqWbHtV/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFFtbteAS90dUGYgHC1WU8jEhrXLjb1g6NJ2NBBL-sPBrDbUsXDqaMVQb07P68nmd6Ya7pz09i8ZlvcohgOvco8VVWXFmfy6T97Z6mqMvEb2c-hHGVrSmQepCVuL2s57SsojKlMkqWbHtV/s1600/2.jpg" /></a></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div>
2. Now write the test code into the test method (i.e. The method that is annotated with @Test annotation) as shown below and observe that an error is displayed as shown below:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUVhpQB_18z_r7C74ztAKmcoRqc6goKmJm2QZMwUeFYv4Q05_EUUyHN-W4yWDEZ-7uvl_taDpNSmzVv0atWdgu4BivbH4x0hcC2zT5WjYGUBjgXTzXuRIzSKW3jklfjcvOMyJpOsuvEcqP/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUVhpQB_18z_r7C74ztAKmcoRqc6goKmJm2QZMwUeFYv4Q05_EUUyHN-W4yWDEZ-7uvl_taDpNSmzVv0atWdgu4BivbH4x0hcC2zT5WjYGUBjgXTzXuRIzSKW3jklfjcvOMyJpOsuvEcqP/s1600/3.jpg" /></a></div>
<div>
<br /></div>
<br />
3. Lets resolve the error first. Right click on the Error icon and select <span style="color: #cc0000;">Add static import 'org.testng.AssertJUnit.assertTrue'</span> from the list as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4s_Z0X0mhOD4v-CNaYIodHgTBxjyBB-pxNDt-ew-N106Rn7UX55fZ3C3U8n0PXf0eb5LlGAHaHITZgOZ9Pb9vQ-8pgzNoEe1DbLwJjsNxDzttI6gOOKlc_CcW1sYWWCOWVZ7_ZfVqh7Fw/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4s_Z0X0mhOD4v-CNaYIodHgTBxjyBB-pxNDt-ew-N106Rn7UX55fZ3C3U8n0PXf0eb5LlGAHaHITZgOZ9Pb9vQ-8pgzNoEe1DbLwJjsNxDzttI6gOOKlc_CcW1sYWWCOWVZ7_ZfVqh7Fw/s1600/4.jpg" /></a></div>
<br />
4. Ensure that the error got resolved and the import statement got added as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2IC4v8gkaM3udkCFJP1lYfejrc-CmBvJoUsflsDQKNR2JxuIBXTGXUHQxj4T2AySvuWVk0myBAzbBsYNQE6xMYIHaQLOMvvv5rZygj5X60egMPuohmtpF9OMAzDsK8zVi3cZgG5OoqTHo/s1600/5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2IC4v8gkaM3udkCFJP1lYfejrc-CmBvJoUsflsDQKNR2JxuIBXTGXUHQxj4T2AySvuWVk0myBAzbBsYNQE6xMYIHaQLOMvvv5rZygj5X60egMPuohmtpF9OMAzDsK8zVi3cZgG5OoqTHo/s1600/5.jpg" /></a></div>
<br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Start the Selenium Standalone Server</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">6. Save the 'Class65.java' file and Run it using the 'TestNG' as shown below:</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieVWp_seQFDOACrU-rzKotEyJSDajv2Iw5EUCTZqdpWvqhLH8ww9hPTDJrHT98orntWY3VJC2dm1YSscsYOXaUEGLI3HrczTFOEoNbNblsYPFPMZVKxwBq9aSHiDYUIGeXT8ClMXVa1M6F/s1600/6.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieVWp_seQFDOACrU-rzKotEyJSDajv2Iw5EUCTZqdpWvqhLH8ww9hPTDJrHT98orntWY3VJC2dm1YSscsYOXaUEGLI3HrczTFOEoNbNblsYPFPMZVKxwBq9aSHiDYUIGeXT8ClMXVa1M6F/s1600/6.jpg" /></a></div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<br />
7. Ensure that our test has run by TestNG and the results shown in the 'TestNG' tab are passed as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5zzj6rI8fyTnraqPsVfRf9yOe2AuHriXq0hOK2MOtn2TOdjI7llTza33g435UDS1IG-yZqB6noF5UAsBXaQxMx6uqWrHjInwurHFKBafILGWZdj5HCj05NsJ2AUf6UcHDNzq1s6dXJBD0/s1600/7.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5zzj6rI8fyTnraqPsVfRf9yOe2AuHriXq0hOK2MOtn2TOdjI7llTza33g435UDS1IG-yZqB6noF5UAsBXaQxMx6uqWrHjInwurHFKBafILGWZdj5HCj05NsJ2AUf6UcHDNzq1s6dXJBD0/s1600/7.jpg" /></a></div>
<br />
<br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Watch the below video:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<i style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><a href="http://www.youtube.com/watch?v=hv-F-eY9NmI&feature=youtu.be" target="_blank">Click here</a></b></i><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to watch the video.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Download this Project:</span></b><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFQ3ubkmtpiVh9v97qwmRH6Uwyj3F52qlsd57w2zg5S3YCzP80tNIRcOEpTGGcGmDn_GxCbH-PQ_mrVAi28JEA8KeWTLXwUWio3oYD08uNbCVFFHikpnHz2aHPGqJlUq9HWRzZhOhEO0_C/s1600/next5.jpg" imageanchor="1" style="background-color: white; clear: right; color: #771100; float: right; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; margin-left: 1em; text-align: center; text-decoration: none;"><br /></a><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i><a href="http://www.mediafire.com/?lr89959usq7ra3z" target="_blank">Click here</a></i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to download this project and import into Eclipse IDE on your machine.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> </span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br />
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<b><span style="color: #cc0000;"><br /></span></b><span style="color: #38761d;"><b><i><u>Non-Refactored Selenium Automation Code using TestNG framework</u><span style="color: #333333;"> </span></i><span style="color: #333333;"> </span>will be explained in the next post.</b></span></div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" imageanchor="1" style="clear: right; color: #771100; float: right; margin-bottom: 1em; margin-left: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" style="border: none; position: relative;" /></a></div>
Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com0tag:blogger.com,1999:blog-2483593764182960323.post-61088564042315078332013-05-17T03:09:00.001-07:002013-05-17T03:09:16.165-07:00152. Installing TestNG in Eclipse IDE<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvbQOQP9rGZxci1MwKCr7sBRQzifrPtpkMsNXX38EWJFGvA82ZT3GEyrgt8lfWvSjvRkL0-yTsPPE0zw1am3DAJtIuhVa5PtOqDHcFPZE9FVgoqXeN2AdKU-_3fr2LsF7F9U6JUwNRfRu9/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvbQOQP9rGZxci1MwKCr7sBRQzifrPtpkMsNXX38EWJFGvA82ZT3GEyrgt8lfWvSjvRkL0-yTsPPE0zw1am3DAJtIuhVa5PtOqDHcFPZE9FVgoqXeN2AdKU-_3fr2LsF7F9U6JUwNRfRu9/s1600/PreviousPost2.jpg" /></a></div>
<br />
<br />
<br />
<br />
<br />
We have to install TestNG in Eclipse IDE, in order to use TestNG testing Framework in our Selenium Automation Tests.<br />
<br />
<b>Please follow the below steps for installing the TestNG on Eclipse IDE:</b><br />
<br />
1. In Eclipse IDE, select 'Install New Software' option from the Help Menu options as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhC1J7pOZ3nqT2Qg0zKm1gbhmPIAvMegDmHdmXd6G3SlyWYh8yTqBu5JSwKNTsDLlpVMTxoNaeQePbe-Z1jDofIeG-tNMCv1G_tICZP3g2bQj21ztZmVeDsfuGDCAD-ALJyGYEPkcRgyUQZ/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhC1J7pOZ3nqT2Qg0zKm1gbhmPIAvMegDmHdmXd6G3SlyWYh8yTqBu5JSwKNTsDLlpVMTxoNaeQePbe-Z1jDofIeG-tNMCv1G_tICZP3g2bQj21ztZmVeDsfuGDCAD-ALJyGYEPkcRgyUQZ/s1600/1.jpg" /></a></div>
<br />
2. Ensure that 'Install' dialog is displayed as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHLtkpfdeMjHQ94GLFX8axNCMUfSHYrkVa8Ltvj33LDHGnyXbb26wGqQv1Jq9ZSGic4zRxvJEaWjwTbwbklD6QHZS_a2CO0PsxSANLAnMFdEdVKbIFw04_DFmFyhjkMe_jytrTxj8hbkea/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHLtkpfdeMjHQ94GLFX8axNCMUfSHYrkVa8Ltvj33LDHGnyXbb26wGqQv1Jq9ZSGic4zRxvJEaWjwTbwbklD6QHZS_a2CO0PsxSANLAnMFdEdVKbIFw04_DFmFyhjkMe_jytrTxj8hbkea/s1600/2.jpg" /></a></div>
<br />
3. Enter the URL <span style="color: #cc0000;"> <b>http://beust.com/eclipse</b></span> into the 'Works With' text box as shown below and press 'Enter' Button on your Keyboard :<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbLXbPJCcqHXlO_-yMeD7fxUttl0hPpfdY3jW8uuxSs0y9R3Bp5Clxol9G-UTroFIofrHvaNOsI3gvFLypDrs_JypCssBZlMdEtblLMJoPpqR4Ny2je10Riz8ATxCAiJ-peEfhPhF0Bo4D/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbLXbPJCcqHXlO_-yMeD7fxUttl0hPpfdY3jW8uuxSs0y9R3Bp5Clxol9G-UTroFIofrHvaNOsI3gvFLypDrs_JypCssBZlMdEtblLMJoPpqR4Ny2je10Riz8ATxCAiJ-peEfhPhF0Bo4D/s1600/3.jpg" /></a></div>
<br />
4. Ensure that the TestNG is now displayed under the 'Name' column as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtqawFBccWiLAmqo-RNKTkphIY3188V-KFodO_ZiWKjOv2qJk0dxckCqA5uhmBcnYVtaFu1hDj4-RWmyBn_BQfKVLD_tFitar4c9QL9zG3CMqwQk1yZ_eU9Zpy7layrdZMfJIJqED5q_R3/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtqawFBccWiLAmqo-RNKTkphIY3188V-KFodO_ZiWKjOv2qJk0dxckCqA5uhmBcnYVtaFu1hDj4-RWmyBn_BQfKVLD_tFitar4c9QL9zG3CMqwQk1yZ_eU9Zpy7layrdZMfJIJqED5q_R3/s1600/4.jpg" /></a></div>
<br />
<br />
5. Select the 'TestNG' by selecting the check box option of it and then click on 'Next' Button as shown below<br />:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlfSeF4UZG8U-pNZM1bItznZMQX9FgaiOsIenFslckGn-9DbInOAFW1iW0J7UjZUNj5E1NghlebYpNUTKDHgDJGfekTURZr3aHjc47XGbrzv-wFrIH4osUS88wYW2Bldgii5H-PQlfQgzo/s1600/5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlfSeF4UZG8U-pNZM1bItznZMQX9FgaiOsIenFslckGn-9DbInOAFW1iW0J7UjZUNj5E1NghlebYpNUTKDHgDJGfekTURZr3aHjc47XGbrzv-wFrIH4osUS88wYW2Bldgii5H-PQlfQgzo/s320/5.jpg" width="296" /></a></div>
<br />
6. Ensure that the Install Details dialog displaying the TestNG is displayed and click on 'Next' button as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEird6vF49U-Kn8-Ajxn9tzexCxL4Gf3V-_Z3Emgf_qnTUDGHtEAdbBWnsxXojMZXd1GqS5Gc8xxZn70TCjVg1RkpEECqPR9VAuG2xQnOwJkYckn-X7Or0fdenFiROKrBWxPk2ykHmqb1F5O/s1600/6.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEird6vF49U-Kn8-Ajxn9tzexCxL4Gf3V-_Z3Emgf_qnTUDGHtEAdbBWnsxXojMZXd1GqS5Gc8xxZn70TCjVg1RkpEECqPR9VAuG2xQnOwJkYckn-X7Or0fdenFiROKrBWxPk2ykHmqb1F5O/s320/6.jpg" width="293" /></a></div>
<br />
7. Ensure that the 'Review Licenses' dialog is displayed, select the radio button 'I accept the terms...' and click on 'Finish' button as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNFSMOLwawgqY0ILcR2FZphmV70KsUfqEOagM77qYC5EOwaA7clnJ2ncIN-UDUXd3weNvmB4Bc9wKh3RlHwOvbn8CnHRWg_Bf5NR2It4cQ4pTSMAfZCDk_y4GRrGgl5KP5eSGgkCt1lHyy/s1600/7.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNFSMOLwawgqY0ILcR2FZphmV70KsUfqEOagM77qYC5EOwaA7clnJ2ncIN-UDUXd3weNvmB4Bc9wKh3RlHwOvbn8CnHRWg_Bf5NR2It4cQ4pTSMAfZCDk_y4GRrGgl5KP5eSGgkCt1lHyy/s320/7.jpg" width="294" /></a></div>
<br />
8. Ensure that Installing Software dialog is displayed as shown below:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgn12IJ5XMs4yMSFRIKeVT_nEhomiLRAbGost2sOmAkk3D3T1ZjgUSna1H2MvcI8N0FDZAQvW_JhJnghpkapK2YrqBrohqTSBKGFa5FuwB1oR5N1p6QwRSyspfSjHPEWYiN2Tptz71BewCa/s1600/8.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgn12IJ5XMs4yMSFRIKeVT_nEhomiLRAbGost2sOmAkk3D3T1ZjgUSna1H2MvcI8N0FDZAQvW_JhJnghpkapK2YrqBrohqTSBKGFa5FuwB1oR5N1p6QwRSyspfSjHPEWYiN2Tptz71BewCa/s1600/8.jpg" /></a></div>
<br />
9. While the installation is in Progress, you may get the 'Security Warning' dialog as shown below. If you get this dialog, click on 'OK' button to continue the installation.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggJ8DC7FT_2aR14xiM1PlUfxRNrmvC2C8MpGDRBLRPLVLdDyQwTy3gXjsX5OkJ-t9YvyQLRSBxCuSMqpxiTf4Z5qNZdUTVFmkY-I2aZaeWPpny-fZ53GUaDZbjMB_okcOZZPuJLJAQkh8c/s1600/9.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggJ8DC7FT_2aR14xiM1PlUfxRNrmvC2C8MpGDRBLRPLVLdDyQwTy3gXjsX5OkJ-t9YvyQLRSBxCuSMqpxiTf4Z5qNZdUTVFmkY-I2aZaeWPpny-fZ53GUaDZbjMB_okcOZZPuJLJAQkh8c/s1600/9.jpg" /></a></div>
<br />
10. Ensure that the installation is continued as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAUNJO3E4kdHa36lZ17v2xrxsUQp7QohYRpGvIx2_oauvRyngUUqw8IV01wO_D3RWlmP-ifYoGKwTjP6UHPvwyoWVhylonLa0S-baeRymn8CRbhdBOcGgIvLatZL9xyxY0zyII8aic225k/s1600/10.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAUNJO3E4kdHa36lZ17v2xrxsUQp7QohYRpGvIx2_oauvRyngUUqw8IV01wO_D3RWlmP-ifYoGKwTjP6UHPvwyoWVhylonLa0S-baeRymn8CRbhdBOcGgIvLatZL9xyxY0zyII8aic225k/s1600/10.jpg" /></a></div>
<br />
11. Wait for the installation progress to complete, and ensure that the 'Software Update' dialog is displayed as shown below and click on 'Yes' button:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3kF3JE-ythrpE1F7Q5Y63AxKxblnBw8oWOqpu2JFtfxoip5mJLNrrzb32vNE4JOSyH0Ii8x9iQ64OjzMMg1M-eQWah1ZNEcTU00tZrlX_P5dCS_1G9bZZf2CEydM9ZqC2lYCcOWpkrsYi/s1600/11.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3kF3JE-ythrpE1F7Q5Y63AxKxblnBw8oWOqpu2JFtfxoip5mJLNrrzb32vNE4JOSyH0Ii8x9iQ64OjzMMg1M-eQWah1ZNEcTU00tZrlX_P5dCS_1G9bZZf2CEydM9ZqC2lYCcOWpkrsYi/s1600/11.jpg" /></a></div>
<br />
12. Ensure that the Eclipse IDE gets restarted.<br />
<br />
<b>Check whether the TestNG is installed:</b><br />
<br />
In Eclipse IDE, select 'Run As' option from the 'Run' Menu options and ensure that the 'TestNG' option is displayed as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEd2TxRM2sledxI0TTfrKYxOkuALisY8VqR9chpJ3zBuKJd3kvODnm-InCpSWf9acT38rPmkemsM5j7gFFO49RebfHeMTustaO8HajUUDkMRzRW3P9rUzfVlOHcPOfHagBYaH_UUksYNus/s1600/12.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="350" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEd2TxRM2sledxI0TTfrKYxOkuALisY8VqR9chpJ3zBuKJd3kvODnm-InCpSWf9acT38rPmkemsM5j7gFFO49RebfHeMTustaO8HajUUDkMRzRW3P9rUzfVlOHcPOfHagBYaH_UUksYNus/s640/12.jpg" width="640" /></a></div>
<br />
<br />
This is how, we've to install the TestNG software on Eclipse IDE.<br />
<br />
<br />
<br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" /><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #38761d;"><i><u><br /></u></i></span></b><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #38761d;"><i><u>Using TestNG Annotations in Selenium RC code</u></i> will be explained in the next post.</span></b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEih7qcigsjIZt3ze8djioz-D5XzZuFxazS1cBtqep6W42ivpUEEMi1WxgM_L_KL9XC5Di75gphkZ9vdXFr7Dx1qj7SAro-eXCheq5YbGlsX1ny677SI4xPzPlMosIezMuY7HJUkLwofZ3uY/s1600/next5.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEih7qcigsjIZt3ze8djioz-D5XzZuFxazS1cBtqep6W42ivpUEEMi1WxgM_L_KL9XC5Di75gphkZ9vdXFr7Dx1qj7SAro-eXCheq5YbGlsX1ny677SI4xPzPlMosIezMuY7HJUkLwofZ3uY/s1600/next5.jpg" /></a></div>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #38761d;"><br /></span></b>Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com0tag:blogger.com,1999:blog-2483593764182960323.post-85193821183723283732013-05-17T00:21:00.002-07:002013-05-17T03:41:19.507-07:0010. Using JUnit annotations in our Selenium RC Tests<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnbnwV2LymzoTRkEbhr2knFgWzR4tfB13TD-YutihIVfwIEPTnDlJ1cY_7FbUXjbjdhAR0ddnMGxtGy_XJWoYVJUZJNk_eurp86bxQnVdWXdVmlnDT3HMPy9DENUlDnCHOmImJhI6kYVGZ/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnbnwV2LymzoTRkEbhr2knFgWzR4tfB13TD-YutihIVfwIEPTnDlJ1cY_7FbUXjbjdhAR0ddnMGxtGy_XJWoYVJUZJNk_eurp86bxQnVdWXdVmlnDT3HMPy9DENUlDnCHOmImJhI6kYVGZ/s1600/PreviousPost2.jpg" /></a></div>
<br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">In order to Run a </span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i>Selenium RC Test </i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">using </span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i>JUnit</i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">, we have to add few </span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; font-style: italic; line-height: 20px;">JUnit Annotations</b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> </span><i style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">to the </i><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i>Selenium RC Test</i></b><i style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> code:</i><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><i><br /></i></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">To start with lets use the following JUnit Annotations in our Selenium RC Tests:</span></span><br />
<ol style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<li style="margin: 0px 0px 0.25em; padding: 0px;"><i>@Before</i></li>
<li style="margin: 0px 0px 0.25em; padding: 0px;"><i>@After</i></li>
<li style="margin: 0px 0px 0.25em; padding: 0px;"><i>@Test</i></li>
</ol>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<i><br /></i></div>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<i>As we've already run a <b>Selenium RC Test</b> </i>code in<b><i> Eclipse IDE</i></b> i.e <b><i><span style="color: red;">Run As -> JUnit Test</span></i></b> in our previous <a href="http://seleniumone-by-arun.blogspot.in/2013/03/8-run-created-selenium-rc-test.html" style="color: #771100; text-decoration: none;" target="_blank">post#8 Run the Created Selenium RC Test</a>. Lets look into the Test code and find out whether it has JUnit annotation specified or not.</div>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<br /></div>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
1. View the Selenium RC Test code which we have already Run as shown below and find out whether the code has JUnit annotations specified:</div>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<br /></div>
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
</div>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFTRMHeL1_mpi4bMOvh2Rk_YbNa5xu3ojhsFplDJ1n1WAB6evi8cNBf72Z9feGmLV7gHPDncjbVS-pZRrSyRPwwUpkbRquXnQJsSUzMze2AA8ZhbAVRcsQdPDyOnLcYonOGIDRccUlHLHG/s1600/JUnit+Annotations.jpg" imageanchor="1" style="color: #771100; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" height="422" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFTRMHeL1_mpi4bMOvh2Rk_YbNa5xu3ojhsFplDJ1n1WAB6evi8cNBf72Z9feGmLV7gHPDncjbVS-pZRrSyRPwwUpkbRquXnQJsSUzMze2AA8ZhbAVRcsQdPDyOnLcYonOGIDRccUlHLHG/s640/JUnit+Annotations.jpg" style="border: none; position: relative;" width="640" /></a></div>
</div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. After viewing the Test code its very clear that the Selenium RC Test is using the JUnit Annotations @Before, @Test and @ After.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue; font-size: medium;">@Test</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">All the methods in the class which are specified as </span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i><span style="color: #cc0000;">@Test</span></i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> as shown in the below screenshot will be executed by the JUnit (i.e. when we select </span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i>Run As -> JUnit Test</i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> ) as shown below:</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK8yp_FJ7Fo8kbFsGDBcKIBkmEYQm2pvUfEeSCtQHm4TmVl4oXrbBbpVUY21zPWSexO2hOcM14oE6zVAiU7qALjKZdwZMAOzdmAzF8atsH2y65HphTbWzJvdupjwQVW5pagszdjlboeD-o/s1600/AtTest.jpg" imageanchor="1" style="color: #771100; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" height="354" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK8yp_FJ7Fo8kbFsGDBcKIBkmEYQm2pvUfEeSCtQHm4TmVl4oXrbBbpVUY21zPWSexO2hOcM14oE6zVAiU7qALjKZdwZMAOzdmAzF8atsH2y65HphTbWzJvdupjwQVW5pagszdjlboeD-o/s640/AtTest.jpg" style="border: none; position: relative;" width="640" /></a></div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue; font-size: medium;">@Before</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">All the methods in the class which are specified as </span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i><span style="color: #cc0000;">@Before</span></i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> as shown in the below screenshot will be executed by the JUnit before executing the methods which are specified as @Test in the same class. @Before is mainly used to setup some objects needed by tests. @Before specified methods are a kind of setup methods. (as shown below):</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm5PUe0fZbuYuJh7LjjSnBp70CBtOWy7JXLX2rqlMv9RJ6vAevfsgpctprB3DO4N66SYD2qXnM8L9f8GX0BgmewfXCAwrqkg1RT6ZoQ2zby87-yAsXCEdZq2VSA84sZbkY42QyMyclQCeo/s1600/AtBefore.jpg" imageanchor="1" style="color: #771100; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" height="354" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm5PUe0fZbuYuJh7LjjSnBp70CBtOWy7JXLX2rqlMv9RJ6vAevfsgpctprB3DO4N66SYD2qXnM8L9f8GX0BgmewfXCAwrqkg1RT6ZoQ2zby87-yAsXCEdZq2VSA84sZbkY42QyMyclQCeo/s640/AtBefore.jpg" style="border: none; position: relative;" width="640" /></a></div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue; font-size: medium;">@After</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">All the methods in the class which are specified as </span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i><span style="color: #cc0000;">@After</span></i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> as shown in the below screenshot will be executed by the JUnit after executing the methods which are specified as @Test in the same class (as shown below):</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxPk9nvK-joFpCYxGVpfNeGvliY23Gka3gA7io4fUjg8ZsVQnDMu12ihDWhGtNiagl7czmx-6BLeATsSZdOH3ygfxHUw2hcmcpSYfeuO3UmOBzf_qH1OASW9CLHnbHJOatV0_w7_ndAAgh/s1600/atAfter.jpg" imageanchor="1" style="color: #771100; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" height="350" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxPk9nvK-joFpCYxGVpfNeGvliY23Gka3gA7io4fUjg8ZsVQnDMu12ihDWhGtNiagl7czmx-6BLeATsSZdOH3ygfxHUw2hcmcpSYfeuO3UmOBzf_qH1OASW9CLHnbHJOatV0_w7_ndAAgh/s640/atAfter.jpg" style="border: none; position: relative;" width="640" /></a></div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Running the Selenium RC Test code without Annotations:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Comment the JUnit annotations from the Selenium RC Test code as shown below:</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDMXmVAb5aSrNybJRu1qU04iH9FhMZ4L8VJS8GlGU1ipKMYeqEL8ynwuRz8x6O-3gT_1pZAe8kjJv6wjzRliNh8yZ2YqzxBkWaX-Wspd9HOQrbi7P0mWYk5Y_Of6zHr3Olx-v8zldCPmVE/s1600/Commented.jpg" imageanchor="1" style="color: #771100; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" height="356" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDMXmVAb5aSrNybJRu1qU04iH9FhMZ4L8VJS8GlGU1ipKMYeqEL8ynwuRz8x6O-3gT_1pZAe8kjJv6wjzRliNh8yZ2YqzxBkWaX-Wspd9HOQrbi7P0mWYk5Y_Of6zHr3Olx-v8zldCPmVE/s640/Commented.jpg" style="border: none; position: relative;" width="640" /></a></div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Run the Selenium RC Test code with JUnit Test after commenting the annotations as shown below:</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY2rSz8FdYJddIQXy6K24PoQ1fMwvJBx6II187k9sZuE4vYgH68pkAnLwLriNMpIvkYyiauVDZmdFHgSu-5_fIp_gd3D_rgahRVRZUrbIPGAIgHVcFHOaBPUr_d7yTrVx-sBsPeMa_2MNM/s1600/NoSelection.jpg" imageanchor="1" style="color: #771100; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" height="426" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY2rSz8FdYJddIQXy6K24PoQ1fMwvJBx6II187k9sZuE4vYgH68pkAnLwLriNMpIvkYyiauVDZmdFHgSu-5_fIp_gd3D_rgahRVRZUrbIPGAIgHVcFHOaBPUr_d7yTrVx-sBsPeMa_2MNM/s640/NoSelection.jpg" style="border: none; position: relative;" width="640" /></a></div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
</div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. Hence, we cannot run the Selenium RC Test with JUnit if the code don't contain any JUnit annotations.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Now remove the comments for the annotations as shown below:</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeAa1OuRGtEG4i8S0kraiAZFBeXkRjeY7Ayix9RLgtpOlLw_zXM696hDBYcSa3XHfTj_BfTklgEEKPCjqWyK_zwNc3Afh4ZVtQ2eeGfOTRb4R4eRHJYn3hjRssuFNUDbEkS4xYjWIk-uX3/s1600/CommentsRemoved.jpg" imageanchor="1" style="color: #771100; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" height="358" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeAa1OuRGtEG4i8S0kraiAZFBeXkRjeY7Ayix9RLgtpOlLw_zXM696hDBYcSa3XHfTj_BfTklgEEKPCjqWyK_zwNc3Afh4ZVtQ2eeGfOTRb4R4eRHJYn3hjRssuFNUDbEkS4xYjWIk-uX3/s640/CommentsRemoved.jpg" style="border: none; position: relative;" width="640" /></a></div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Try to Run the Selenium RC test using JUnit as shown below:</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
</div>
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI22kpP_nY9-WzlerwuwDnEbi1VDms5oS5cDOX5RhSmLpx-_tQBzHHwR0BIL3h0KEO04LAAYOROhzG7JxVZ_X38Dc95V89nAfed3viXYhP2P5bZOAc_1a4HKL8mZodydJHFzrLTT3qc0-5/s1600/junit.jpg" imageanchor="1" style="color: #771100; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" height="488" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI22kpP_nY9-WzlerwuwDnEbi1VDms5oS5cDOX5RhSmLpx-_tQBzHHwR0BIL3h0KEO04LAAYOROhzG7JxVZ_X38Dc95V89nAfed3viXYhP2P5bZOAc_1a4HKL8mZodydJHFzrLTT3qc0-5/s640/junit.jpg" style="border: none; position: relative;" width="640" /></a></div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">6. Hence, we can run the Selenium RC Test using JUnit annotations if and only if the test code contains JUnit annotations else </span><i style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><u>JUnit Test</u></i><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> option wont be available to Run the test.</span><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #38761d;"><i><u><br /></u></i></span></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #38761d;"><i><u>Eclipse Automatically adds the Package Name into the newly created Java Class</u></i> will be explained in the next post.</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="http://selenium1-by-arun.blogspot.in/2013/03/9-eclipse-ide-automatically-adds.html" style="color: #771100; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhzZ6SQ8FZq_OB3ZxE8dBqxDXJCIj2HAVqK2g8cNIZNFrcYZJEYg4W77RgRWhuMIR91NRNJrWayvJAbBTRx0_FgXwEjXhyphenhyphenbn3VUQgG6f81axYTQ0brl6UKGINTBjYC5noyu0xvtWdmhlS8/s1600/next5.jpg" style="border: none; position: relative;" /></a></div>
Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com0tag:blogger.com,1999:blog-2483593764182960323.post-41463807566651092092013-05-16T23:43:00.001-07:002013-05-17T01:00:25.362-07:00151. Introduction to TestNG<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRJDAvXP7kzNUiSqvYIqpvWwlJhdX7afverl-KViX9YQaH0YASymJCoJlt8CFekZ258p_b0Tez4T4qi9-vemflxPy83N7s0077zWj_LEhtj1GYYaj6x43JwkYNUcIMUreoMdWgYyr6ui7e/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRJDAvXP7kzNUiSqvYIqpvWwlJhdX7afverl-KViX9YQaH0YASymJCoJlt8CFekZ258p_b0Tez4T4qi9-vemflxPy83N7s0077zWj_LEhtj1GYYaj6x43JwkYNUcIMUreoMdWgYyr6ui7e/s1600/PreviousPost2.jpg" /></a></div>
<br />
<br />
<br />
<br />
<br />
<b><span style="color: #cc0000;">TestNG</span></b> is a powerful testing Framework.<br />
<br />
Till now we have used JUnit testing Framework in our Selenium Automation Tests. As TestNG testing Framework is more powerful and has many advantages over JUnit testing Framework, lets prefer to write our Selenium Automation Tests on TestNG testing Framework from now on wards.<br />
<br />
<b>Why TestNG is more powerful than JUnit ?</b><br />
<b><br /></b>
TestNG is more advance in parameterized testing, dependency testing and suite testing (Grouping concept). TestNG is meant for high-level testing and complex integration test. Its flexibility is especially useful with large test suites. In addition, TestNG also cover the entire core JUnit 4 functionality. It's just no reason for us to use JUnit anymore.<br />
<br />
<b>How to Run Selenium RC Tests using TestNG testing Framework ?</b><br />
<br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">In order to Run a </span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i>Selenium RC Test </i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">using <b><i>TestNG</i></b></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">, we have to perform the following things first:</span><br />
<ol>
<li><span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">Install TestNG in Eclipse IDE</span></span></li>
<li><span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">Use TestNG annotations in Selenium RC code</span></span></li>
</ol>
<br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" /><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #38761d;"><i><u><br /></u></i></span></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #38761d;"><i><u>Installing TestNG in Eclipse IDE</u></i> will be explained in the next post.</span></b><br />
<span style="color: #38761d;"><b><br style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" /></b></span><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="http://selenium1-by-arun.blogspot.in/2013/03/9-eclipse-ide-automatically-adds.html" style="clear: right; color: #771100; float: right; margin-bottom: 1em; margin-left: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhzZ6SQ8FZq_OB3ZxE8dBqxDXJCIj2HAVqK2g8cNIZNFrcYZJEYg4W77RgRWhuMIR91NRNJrWayvJAbBTRx0_FgXwEjXhyphenhyphenbn3VUQgG6f81axYTQ0brl6UKGINTBjYC5noyu0xvtWdmhlS8/s1600/next5.jpg" style="border: none; position: relative;" /></a></div>
Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com0tag:blogger.com,1999:blog-2483593764182960323.post-28788328089931137702013-05-14T04:45:00.003-07:002013-05-14T05:29:35.433-07:00150. Installing Ant Tool<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnKYr1SWAiSmSRcqfTpyqMGyiml2kEPINQBqP5A-QPMFCwoU-yZ-E4r22zkRteOVZeZaEEyOKdTLUl7A9yUJLTldktsQxNqw3GNyIILP3mM9hQuLwnQ54CKMz9MXB3FIoeH2LdQkK6TpPs/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnKYr1SWAiSmSRcqfTpyqMGyiml2kEPINQBqP5A-QPMFCwoU-yZ-E4r22zkRteOVZeZaEEyOKdTLUl7A9yUJLTldktsQxNqw3GNyIILP3mM9hQuLwnQ54CKMz9MXB3FIoeH2LdQkK6TpPs/s1600/PreviousPost2.jpg" /></a></div>
<br />
<br />
<br />
<b><br /></b>
<b><br /></b>
<b><span style="color: blue;">Prerequisite:</span></b><br />
<br />
Before Installing Ant Software Tool, first we've to have the JDK version of the Java installed and configured.<br />
<br />
Please go through the previous posts listed below:<br />
<br />
<ul>
<li><a href="http://selenium-by-arun.blogspot.in/2013/02/30-install-java-jdk.html" target="_blank">Install Java JDK</a></li>
<li><a href="http://selenium-by-arun.blogspot.in/2013/02/31-configure-java.html" target="_blank">Configure Java</a></li>
</ul>
<div>
<br /></div>
<div>
<b><span style="color: blue;">Installing Ant:</span></b></div>
<div>
<br /></div>
<div>
Please follow the below build to download and install the Ant Software:</div>
<div>
<br /></div>
<div>
1. Open <a href="https://code.google.com/p/winant/" target="_blank">https://code.google.com/p/winant/</a></div>
<div>
2. Click on download the latest version link as shown in the below screenshot:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuDwFBf491UjRtUBryt5Ip80J1dEnVVwsw2FERddfapDgeorO_2qP9sULlCvbrdkdksWv60nQEtjVttPyIFMkePIk17yYuC2YtfFaF_7mG_Dc-7Tfk6ortSqNg1kcWMzy6DUJexGTgycfr/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuDwFBf491UjRtUBryt5Ip80J1dEnVVwsw2FERddfapDgeorO_2qP9sULlCvbrdkdksWv60nQEtjVttPyIFMkePIk17yYuC2YtfFaF_7mG_Dc-7Tfk6ortSqNg1kcWMzy6DUJexGTgycfr/s1600/4.jpg" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
3. Ensure that the .exe file of the winant software got downloaded as shown below:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzlUewtFHXJucbdZgrkkLevw3PLlKRY4OwfGjJH1XM-j48lZWA2uG7GxoRWAlCNNyuvkKHsMB72kcsuRBsfsEKf63qz6gTtA7WiO5CSPyjPyEipHUNUSztM-R2Gvc0aGQo7BaR1Znj1AuF/s1600/5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzlUewtFHXJucbdZgrkkLevw3PLlKRY4OwfGjJH1XM-j48lZWA2uG7GxoRWAlCNNyuvkKHsMB72kcsuRBsfsEKf63qz6gTtA7WiO5CSPyjPyEipHUNUSztM-R2Gvc0aGQo7BaR1Znj1AuF/s1600/5.jpg" /></a></div>
<div>
<br /></div>
<div>
4. Double click the .exe file and click on 'Next' button on the displayed 'WinAnt Setup: License Agreement' dialog a shown below:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiD-qRxTXNAl2h2LVCCQz7kMVDD-jYIfOf_qt0nbSdakQfQ3iSAQtWnOma_VtQ7v5Uf_6WWODaqfaqVtwFyYPW46anzF6xFSYpB2lpJn7Sd18YxoOjTxxSzI47bSOXMY7b1cVzxxynWzNA4/s1600/6.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiD-qRxTXNAl2h2LVCCQz7kMVDD-jYIfOf_qt0nbSdakQfQ3iSAQtWnOma_VtQ7v5Uf_6WWODaqfaqVtwFyYPW46anzF6xFSYpB2lpJn7Sd18YxoOjTxxSzI47bSOXMY7b1cVzxxynWzNA4/s1600/6.jpg" /></a></div>
<div>
<br /></div>
<div>
5. Ensure that 'Ant' and 'Ant-Contrib tasks' checkbox options are selected and click on 'Next' Button as shown below:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy7qzH-80XTeNqzvRnrLwhD7jvrzKFNmHu5RVr1k1A9p3LNh_X4aN9I1Po9dRJhuam0kR6_N8qATt1pA521DVYnUYAI9woQQzxirK1_npJ6JDs8PDhOXcS-hSljlwSiDBbFsURRchFra6W/s1600/7.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy7qzH-80XTeNqzvRnrLwhD7jvrzKFNmHu5RVr1k1A9p3LNh_X4aN9I1Po9dRJhuam0kR6_N8qATt1pA521DVYnUYAI9woQQzxirK1_npJ6JDs8PDhOXcS-hSljlwSiDBbFsURRchFra6W/s1600/7.jpg" /></a></div>
<div>
<br /></div>
<div>
6. Ensure that the Installation wizard is asking to browse the 'Java Directory' and click on 'Browser' button as shown below:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvFJq4nf1n4IZmoOk_vmnW0UezMuoUjqo3DEXkjg4psm9tJP6ax6jA3DK0YApBSUc6_tJj_6cN1hfQPOmSqRiwXBPqHjQ78BcUwAqH-oW93u8glreD_sRr-LQNW-105sHff_DYgV7negZn/s1600/8.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvFJq4nf1n4IZmoOk_vmnW0UezMuoUjqo3DEXkjg4psm9tJP6ax6jA3DK0YApBSUc6_tJj_6cN1hfQPOmSqRiwXBPqHjQ78BcUwAqH-oW93u8glreD_sRr-LQNW-105sHff_DYgV7negZn/s1600/8.jpg" /></a></div>
<div>
7. Ensure that the 'Browser For Folder' dialog is displayed, select the JDK folder which is under the C Drive -> Program files -> Java folder and click on 'OK' button as shown below:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyPrqu-8RVzLzDEy9c-whVUZcVKWSSpGe5Og73q5kSDdmyy8tXwbiTHrse69oNapLP4iyWlQG0e8ajkfaaMS1yS6uBorDV3FHvhN8IQYv0gnNhAVjvo6i8CKNr0ck7NsFNnWSsDnduvzN9/s1600/9.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyPrqu-8RVzLzDEy9c-whVUZcVKWSSpGe5Og73q5kSDdmyy8tXwbiTHrse69oNapLP4iyWlQG0e8ajkfaaMS1yS6uBorDV3FHvhN8IQYv0gnNhAVjvo6i8CKNr0ck7NsFNnWSsDnduvzN9/s1600/9.jpg" /></a></div>
<div>
<br /></div>
<div>
8. Ensure that the Java Directory path is displayed in the text box and click on 'Next' Button as shown below:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2KNaqATyo5VebBvRDDUtUlfbkvKvnt3U5I5us3avVC8m-FR7nl1XQ4HYlx7SGF7khhe4ZthYt7NZVS1iVTBLjFDg6DyyeR7a5hapAt9peTFFUN0S_QSlr2kSSyiqI3lVBADJtVBPXJ-O3/s1600/10.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2KNaqATyo5VebBvRDDUtUlfbkvKvnt3U5I5us3avVC8m-FR7nl1XQ4HYlx7SGF7khhe4ZthYt7NZVS1iVTBLjFDg6DyyeR7a5hapAt9peTFFUN0S_QSlr2kSSyiqI3lVBADJtVBPXJ-O3/s1600/10.jpg" /></a></div>
<div>
<br /></div>
<div>
9. Ensure that the 'Installation Folder' wizard screen is displayed and click on 'Install' button as shown below:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpSSHebUv64xXLt_ZwSIZRClq0oyk4NLQ_1CVbLD9DVm09fn2G7fEgiD7zid9LpvjGE97P3Jvy0x8OuudV9Ltve1DwzOiB3W3MLEA92nSfvXgTiiybJkqtPD5zCU0yCzkNDSyHysIBpT-m/s1600/11.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpSSHebUv64xXLt_ZwSIZRClq0oyk4NLQ_1CVbLD9DVm09fn2G7fEgiD7zid9LpvjGE97P3Jvy0x8OuudV9Ltve1DwzOiB3W3MLEA92nSfvXgTiiybJkqtPD5zCU0yCzkNDSyHysIBpT-m/s1600/11.jpg" /></a></div>
<div>
<br /></div>
<div>
10. Ensure that completed message is displayed and also a dialog asking the User to restart the computer is displayed as shown below:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMNb3T3MmBLh72w1Kk7-uxw_M_hhdVYENMWuIS2upzz7nUZXumv7Jm6-OuwQBSPes55ncuYYBixHEY4GlGLmBpbGK3239bNMkQIiJaYTjqazhirQON4F0jnajHgW1TTOMQU2pmp9HrVqW-/s1600/12.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMNb3T3MmBLh72w1Kk7-uxw_M_hhdVYENMWuIS2upzz7nUZXumv7Jm6-OuwQBSPes55ncuYYBixHEY4GlGLmBpbGK3239bNMkQIiJaYTjqazhirQON4F0jnajHgW1TTOMQU2pmp9HrVqW-/s1600/12.jpg" /></a></div>
<div>
<br /></div>
<div>
11. Restart the Computer<br />
<br />
<br />
<div>
<b><span style="color: blue;"><br /></span></b>
<b><span style="color: blue;">Check whether the Installed Ant Software is working:</span></b></div>
<div>
<br /></div>
<div>
Please follow the below steps to check whether the Installed Ant Software is working or not:<br />
<br />
<span style="background-color: white; color: #606060; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Open Windows Command line as shown below:</span><br style="background-color: white; color: #606060; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" /><b style="background-color: white; color: #606060; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #38761d;"><br /></span></b><span style="background-color: white; color: #606060; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><br />
<div class="separator" style="background-color: white; clear: both; color: #606060; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOuBKrB90TS1LgBdWgOBpIvGjiLMNZ6a5qnycZGP8pon1I6Lg_i9IFZasf-6t-kFuL_ItryFeMOSSMJGfimdDPxwKXCuSvMz6eyvhM8dVTQ0jvut8JEggpRJ66qfslD6wWWoQmOEjuiTSV/s1600/1.jpg" imageanchor="1" style="color: #7575d1; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOuBKrB90TS1LgBdWgOBpIvGjiLMNZ6a5qnycZGP8pon1I6Lg_i9IFZasf-6t-kFuL_ItryFeMOSSMJGfimdDPxwKXCuSvMz6eyvhM8dVTQ0jvut8JEggpRJ66qfslD6wWWoQmOEjuiTSV/s1600/1.jpg" style="border: none; position: relative;" /></a></div>
<br style="background-color: white; color: #606060; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" /><span style="background-color: white; color: #606060; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Type the command </span><b style="background-color: white; color: #606060; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">ant</span></b><span style="background-color: white; color: #606060; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> in the Command line window as shown below and press 'Enter' key on your keyboard as shown below:</span><br />
<span style="background-color: white; color: #606060; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7FtnNA9sF3cnTIUkt0qv7jwLF-J0I_AEoE-ubYjzFdxBf6caQAyIPYP4PhtcoOKXFdXs-yW6CL5zDWO5YgjFFcE6plGzyrJ8IQpOw_rsm1l3t1Lxqxraica-i-cWOreI0RXbmAtiVmOPy/s1600/13.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7FtnNA9sF3cnTIUkt0qv7jwLF-J0I_AEoE-ubYjzFdxBf6caQAyIPYP4PhtcoOKXFdXs-yW6CL5zDWO5YgjFFcE6plGzyrJ8IQpOw_rsm1l3t1Lxqxraica-i-cWOreI0RXbmAtiVmOPy/s1600/13.jpg" /></a></div>
<span style="background-color: white; color: #606060; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="color: #606060; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">3. Ensure that the below message is displayed in the command line window as shown in the below screen:</span></span><br />
<span style="color: #cc0000; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #cc0000; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">Buildfile: build.xml does not exist! </span></span><br />
<span style="color: #cc0000; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">Build failed</span></span><br />
<span style="color: #606060; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6E-xBeecsAv3fIhKj1v8udm7CnRi1TQIE-8iHrGRS7mxyBiTBGEZi_y_s5rbUnVokVquH8Dg8qFY5XelZPbRvL8DAqLYE8_lXk_atWZL85DZAbAWrXU2FPHGkbPYaUkuvFAOP2y6Mmet8/s1600/14.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6E-xBeecsAv3fIhKj1v8udm7CnRi1TQIE-8iHrGRS7mxyBiTBGEZi_y_s5rbUnVokVquH8Dg8qFY5XelZPbRvL8DAqLYE8_lXk_atWZL85DZAbAWrXU2FPHGkbPYaUkuvFAOP2y6Mmet8/s1600/14.jpg" /></a></div>
<span style="color: #606060; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #606060; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">If the message shown in the above screenshot is displayed, then you can confirm that Ant Software is installed successfully on your computer.</span></span><br />
<span style="color: #606060; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #606060; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br />
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<b><span style="color: #cc0000;"><br /></span></b><span style="color: #38761d;"><b><i><u>Installing Ant Tool</u><span style="color: #333333;"> </span></i><span style="color: #333333;"> </span>will be explained in the next post.</b></span></div>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<span style="color: #38761d;"><b><br /></b></span></div>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx2QfFx-G-dRXbqmoGp3xpnqhufp2rsh0U7f9453OFfPHBGG-pQ5o2rvN6Jixn3Qhi-dMsUgk1m0M6o8yGuJqg_orJP2V1Kf7pTNmw1ffKuMKJG0lIaV2NjSfdNzR2WVD9W1hs29KI04Bm/s1600/next5.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx2QfFx-G-dRXbqmoGp3xpnqhufp2rsh0U7f9453OFfPHBGG-pQ5o2rvN6Jixn3Qhi-dMsUgk1m0M6o8yGuJqg_orJP2V1Kf7pTNmw1ffKuMKJG0lIaV2NjSfdNzR2WVD9W1hs29KI04Bm/s1600/next5.jpg" /></a></div>
<span style="color: #606060; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span></div>
</div>
Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com0tag:blogger.com,1999:blog-2483593764182960323.post-6843425356617139412013-05-14T02:52:00.004-07:002013-05-15T00:22:49.449-07:00149. Introduction to Ant build tool<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinoEyHGLGQ3CBB5JIobOH4sDNA2PA6UWd4tdahQBijqCn5vZewg_6KNQNrCcXyOtabTtar8HX3VkagiqWb6Mi3pDa1qa0YRnSPiIVpIoqN2iP_PIV4o7Hr8c-z1tiy6zwsJ4KtJTqupfOU/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinoEyHGLGQ3CBB5JIobOH4sDNA2PA6UWd4tdahQBijqCn5vZewg_6KNQNrCcXyOtabTtar8HX3VkagiqWb6Mi3pDa1qa0YRnSPiIVpIoqN2iP_PIV4o7Hr8c-z1tiy6zwsJ4KtJTqupfOU/s1600/PreviousPost2.jpg" /></a></div>
<br />
<br />
<br />
<b><span style="color: blue;"><br /></span></b>
<b><span style="color: blue;"><br /></span></b>
<b><span style="color: blue;"><br /></span></b>
<b><span style="color: blue;">What is Ant ?</span></b><br />
<br />
1. Ant is a software tool for automating software build processes.<br />
2. Ant uses XML (i.e. configuration file) to describe the build process and its dependencies.<br />
3. Ant is a command line tool whose mission is to drive process described in build files.<br />
4. When compare to other Build systems, Ant is simple enough and hence it is suitable tool for beginners.<br />
5. Ant is an open source tool developed in JAVA.<br />
6. With Ant we can run Selenium Tests without using Eclipse IDE. I mean we can run the tests from the Windows command line. (But we required Eclipse IDE to write the Selenium RC tests as usual).<br />
<br />
<br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br />
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<b><span style="color: #cc0000;"><br /></span></b><span style="color: #38761d;"><b><i><u>Installing Ant Tool</u><span style="color: #333333;"> </span></i><span style="color: #333333;"> </span>will be explained in the next post.</b></span></div>
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<span style="color: #38761d;"><b><br /></b></span></div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" imageanchor="1" style="clear: right; color: #771100; float: right; margin-bottom: 1em; margin-left: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" style="border: none; position: relative;" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com0tag:blogger.com,1999:blog-2483593764182960323.post-53960960356186971702013-05-13T09:00:00.000-07:002013-05-17T12:14:27.090-07:00148. Using highlight command<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8mquLxyqbcMhpX_IZIbolHyZstzImNj9vxVcBy-UZL5oiif1h-h4fQSLRkTgz1pvCK7e17CP9wgLKwVM4NfAwGK6MhoWRcfb8fhwm8AasBK0Rs1Z9RTiGOAaclwK03hYRNTTW05KWwWc6/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8mquLxyqbcMhpX_IZIbolHyZstzImNj9vxVcBy-UZL5oiif1h-h4fQSLRkTgz1pvCK7e17CP9wgLKwVM4NfAwGK6MhoWRcfb8fhwm8AasBK0Rs1Z9RTiGOAaclwK03hYRNTTW05KWwWc6/s1600/PreviousPost2.jpg" /></a></div>
<br />
<br />
<br />
<b><span style="color: #cc0000;"><br />highlight</span></b> Selenium RC command highlights the elements on the screen while the automation script is running.<br />
<br />
<b>Advantages:</b><br />
<br />
1. To debug your tests<br />
2. To locate the elements you want to draw attention to.<br />
<br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Test Description:</span></b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;"><br /></span></b>
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">As explained in the below screenshot:</span></span><br />
<span style="color: blue; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><b><br /></b></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSnet0PvL_PXJE6qXVcemixKrr6T4F1IdzOv9rfnEteUaM3_6LIYZ8yNo_qzYarBRzIQwQPnfTai0E_8HWXyUjRsB9rv7A-tEVY5VYX7olKFxwOptx5KEIflbjnU6Ji25_l1aMPmDcNYOC/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSnet0PvL_PXJE6qXVcemixKrr6T4F1IdzOv9rfnEteUaM3_6LIYZ8yNo_qzYarBRzIQwQPnfTai0E_8HWXyUjRsB9rv7A-tEVY5VYX7olKFxwOptx5KEIflbjnU6Ji25_l1aMPmDcNYOC/s1600/1.jpg" /></a></div>
<span style="color: blue; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><b><br /></b></span></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Syntax:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">selenium.<b>highlight("CSS path for locating elements")</b>;</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Lets Implement This:</span></b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;"><br /></span></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Pre-requisites:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Create a new Project say 'RC-Project64' in Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Configure the Project to work with Selenium RC</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. Configure the Selenium Standalone Server to run from Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Create a package say 'package64' under the newly created project.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Create a Java Class file say 'Class64' under the newly created package as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRAFVtoNgAPPZl3RROSu_hWN-q-4k8JZs3LbQxfvxPRcaBtAQ4h4nXO1Fc4OJCBqwa-WypxePlck0NUA7rAeh3UDItNkWjuadBDW5IWuX7cFEkE8Al7V28N6AAeQcapkP3AIFT_v0mAw7C/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRAFVtoNgAPPZl3RROSu_hWN-q-4k8JZs3LbQxfvxPRcaBtAQ4h4nXO1Fc4OJCBqwa-WypxePlck0NUA7rAeh3UDItNkWjuadBDW5IWuX7cFEkE8Al7V28N6AAeQcapkP3AIFT_v0mAw7C/s1600/2.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Actual Steps:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Write the following code into the newly created Java Class file as shown below and make sure that you resolve all the errors before going to next step:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAMhmI9zLFUTg8mx7JYZZyyLgsMADPWFBsAPMLkw1VCwy2HG5uGn4nPEeZdZY8GDUu_TvE8fr_gtSdb2POV8R9bX18UmZ60iMItnDUegeM2aF_xfvW1RbMgPdmCmiZNREZsstiCOvEGBOv/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAMhmI9zLFUTg8mx7JYZZyyLgsMADPWFBsAPMLkw1VCwy2HG5uGn4nPEeZdZY8GDUu_TvE8fr_gtSdb2POV8R9bX18UmZ60iMItnDUegeM2aF_xfvW1RbMgPdmCmiZNREZsstiCOvEGBOv/s1600/3.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Write the test method 'highlightDemo()' as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTcAe9CXWg-QDudVP70dyO0-6nQwRhfIcE21yuDhCZE0qrGA4eC58ywKA8Dzoq1QQx_xqAPdWMn8jScd90OL1cDBlHCv6kxJnqlK8Hi2YCUNIf-HqLfr6FWWRDllFfhQsu-2J7HBPMmvv2/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTcAe9CXWg-QDudVP70dyO0-6nQwRhfIcE21yuDhCZE0qrGA4eC58ywKA8Dzoq1QQx_xqAPdWMn8jScd90OL1cDBlHCv6kxJnqlK8Hi2YCUNIf-HqLfr6FWWRDllFfhQsu-2J7HBPMmvv2/s1600/4.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Use Selenium RC command <b>highlight </b>individually before entering text into the text fields </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgllZABfRKha5onUrQQ3KqeJMExGDHGEPvEul0CHapGEEMSwZwXrNpOgVMW7k2XHQSIyCqLtxgGUrT_CRun4YPB8WUOySzUY4p97gGD_bFETP0z0qZ2pkJnnY2MryZqcoVr4v-rjwyaLFgs/s1600/5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgllZABfRKha5onUrQQ3KqeJMExGDHGEPvEul0CHapGEEMSwZwXrNpOgVMW7k2XHQSIyCqLtxgGUrT_CRun4YPB8WUOySzUY4p97gGD_bFETP0z0qZ2pkJnnY2MryZqcoVr4v-rjwyaLFgs/s1600/5.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Start the Selenium Standalone Server</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Save and Run the 'Class64.java' file by selecting the 'JUnit Test' option and ensure that our Automation Test has highlighted the text fields before entering text into them as</span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> shown in the below video:</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Watch the below video:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<i style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><a href="http://www.youtube.com/watch?v=yseWaEWEiMo" target="_blank">Click here</a></b></i><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to watch the video.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Download this Project:</span></b><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFQ3ubkmtpiVh9v97qwmRH6Uwyj3F52qlsd57w2zg5S3YCzP80tNIRcOEpTGGcGmDn_GxCbH-PQ_mrVAi28JEA8KeWTLXwUWio3oYD08uNbCVFFHikpnHz2aHPGqJlUq9HWRzZhOhEO0_C/s1600/next5.jpg" imageanchor="1" style="background-color: white; clear: right; color: #771100; float: right; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; margin-left: 1em; text-align: center; text-decoration: none;"><br /></a><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i><a href="http://www.mediafire.com/?2hj8rr9657uzf5a" target="_blank">Click here</a></i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to download this project and import into Eclipse IDE on your machine.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br />
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<b><span style="color: #cc0000;"><br /></span></b><span style="color: #38761d;"><b><i><u>Introduction to Ant build tool</u><span style="color: #333333;"> </span></i><span style="color: #333333;"> </span>will be explained in the next post.</b></span></div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" imageanchor="1" style="clear: right; color: #771100; float: right; margin-bottom: 1em; margin-left: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" style="border: none; position: relative;" /></a></div>
Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com0tag:blogger.com,1999:blog-2483593764182960323.post-39734942023897924042013-05-13T07:36:00.003-07:002013-05-17T11:52:00.228-07:00147. Using goBack command<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzuxstNlSCKcgkXqItxADz6r_dOApnQ_V1PTDlZlDcBzjusdTAVoUYAHxf_ubz3KMR_UikDzC8brJimRZK5S2_FuskaUMXy9LQwjOfq23aWDWXIV1J4-f8kPkdDtnZ86yU2rv5eSy6efP9/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzuxstNlSCKcgkXqItxADz6r_dOApnQ_V1PTDlZlDcBzjusdTAVoUYAHxf_ubz3KMR_UikDzC8brJimRZK5S2_FuskaUMXy9LQwjOfq23aWDWXIV1J4-f8kPkdDtnZ86yU2rv5eSy6efP9/s1600/PreviousPost2.jpg" /></a></div>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">goBack</span></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> Selenium RC command is used for returning to the previous page.</span><br />
<br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Test Description:</span></b><br />
<span style="color: blue;"><b><br /></b></span>
1. Click the following link on the Home Page:<br />
<span style="color: blue;"><b><br /></b></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg2YFahU-QEhwUNMAHUk8Vp0SV1mhxQNTKJBcp_3cekpvlBn9B8bV0xsnr4UkaLZHJYuF26NFdM9EOuFSf4ngnCx2wqRvwwfuiUQcu7xIsmx0DC0o9suNbIPqatnI2XOMh7BLKxOt1-Znm/s1600/7.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg2YFahU-QEhwUNMAHUk8Vp0SV1mhxQNTKJBcp_3cekpvlBn9B8bV0xsnr4UkaLZHJYuF26NFdM9EOuFSf4ngnCx2wqRvwwfuiUQcu7xIsmx0DC0o9suNbIPqatnI2XOMh7BLKxOt1-Znm/s1600/7.jpg" /></a></div>
<span style="color: blue;"><b><br style="background-color: white;" /></b></span>
<span style="color: blue;"><b><br /></b></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. When the User is in 'Selenium143' page, navigate back to the previous 'omayo' page by using the Selenium RC command <b>goBack</b> as explained in the below screenshot:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEju5gQvLfd8eNXoIZ4Ry4hdXPFxK_fw3L-biwL6sgBzLioiIgoluijILaqChuPmwJAVHLrddl2B5HbAtGWEGxw05t5bOkomNWLOHHPWfbKvBS5Vg92WK5Mg6VUDhXKst8hGI7-GBnakuPvV/s1600/8.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEju5gQvLfd8eNXoIZ4Ry4hdXPFxK_fw3L-biwL6sgBzLioiIgoluijILaqChuPmwJAVHLrddl2B5HbAtGWEGxw05t5bOkomNWLOHHPWfbKvBS5Vg92WK5Mg6VUDhXKst8hGI7-GBnakuPvV/s1600/8.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Syntax:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">selenium.<b>goBack( )</b>;</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Lets Implement This:</span></b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;"><br /></span></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Pre-requisites:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Create a new Project say 'RC-Project63' in Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Configure the Project to work with Selenium RC</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. Configure the Selenium Standalone Server to run from Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Create a package say 'package63' under the newly created project.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Create a Java Class file say 'Class63' under the newly created package as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHmNaCptPvlz-1bl0o3H0wiC7f0vakxMXCPsuTc830h2hBzZpwTWgtde11qZXN0QPFVMThT2EQ9EIESETJ82naWRYR74fFhfHzNoKGoMhKbVU9TwD1Vrv2a4LqqoewRjmSiZY8qRty0cPL/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHmNaCptPvlz-1bl0o3H0wiC7f0vakxMXCPsuTc830h2hBzZpwTWgtde11qZXN0QPFVMThT2EQ9EIESETJ82naWRYR74fFhfHzNoKGoMhKbVU9TwD1Vrv2a4LqqoewRjmSiZY8qRty0cPL/s1600/2.jpg" /></a></div>
<br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Actual Steps:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Write the following code into the newly created Java Class file as shown below and make sure that you resolve all the errors before going to next step:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7lRWAtSTZT-tSh6Fw1d04rKlXgx-GfFopP42NHuxuX_XcwWeDzMdMkDlF1mianrACQnmjWu25skcgio22t7Uf4WOHG7k6mStHWxTqV2t4T9BLswchLwPE0-8mqSAkFU-ubjGutQMa1y7Y/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7lRWAtSTZT-tSh6Fw1d04rKlXgx-GfFopP42NHuxuX_XcwWeDzMdMkDlF1mianrACQnmjWu25skcgio22t7Uf4WOHG7k6mStHWxTqV2t4T9BLswchLwPE0-8mqSAkFU-ubjGutQMa1y7Y/s1600/3.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Write the test method 'goBackDemo()' as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5OwkGwRIiMiSuOx6Tl5FRUXmPQDkD9sSpD7rsjRIDeHiyLilaq6jQuF129AeJBSl36ei3AtVkmteKeeucolF7-poqJZE3KUPB7wR5qCZPOlIrLofThsyQYsDW_WbJmacDRtQymmm50Ive/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5OwkGwRIiMiSuOx6Tl5FRUXmPQDkD9sSpD7rsjRIDeHiyLilaq6jQuF129AeJBSl36ei3AtVkmteKeeucolF7-poqJZE3KUPB7wR5qCZPOlIrLofThsyQYsDW_WbJmacDRtQymmm50Ive/s1600/4.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Use Selenium RC command <b>click </b>for navigating to <b>Selenium143</b> page from 'omayo' <b>Home Page</b></span><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #333333;"> and then use Selenium RC command </span><b><span style="color: #cc0000;">goBack</span></b><span style="color: #333333;"> for navigating back to the previous page i.e. 'omayo' <b>Home Page</b> as shown below:</span></span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmlRQOFJRB-YVie7SEFOmqoc4ldeGSQTNDYj8yZsedjRJu-1w-KiekLu8JWbIHTUpDOPN4JRPdt7efjd9XWzowavDRjuCdRJA7yeaySupAXy7ietQGYLtZGo3snTesY4m_azK8rZyhBr71/s1600/9.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmlRQOFJRB-YVie7SEFOmqoc4ldeGSQTNDYj8yZsedjRJu-1w-KiekLu8JWbIHTUpDOPN4JRPdt7efjd9XWzowavDRjuCdRJA7yeaySupAXy7ietQGYLtZGo3snTesY4m_azK8rZyhBr71/s1600/9.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Start the Selenium Standalone Server</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Save and Run the 'Class63.java' file by selecting the 'JUnit Test' option and ensure that our Automation Test has navigated to the Selenium143 page from 'omayo' Home page and then back to the 'omayo' Home Page because of goBack( ) Selenium RC command as</span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> shown in the below video:</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Watch the below video:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<i style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><a href="http://www.youtube.com/watch?v=YWRfYj0QOmA&feature=youtu.be" target="_blank">Click here</a></b></i><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to watch the video.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Download this Project:</span></b><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFQ3ubkmtpiVh9v97qwmRH6Uwyj3F52qlsd57w2zg5S3YCzP80tNIRcOEpTGGcGmDn_GxCbH-PQ_mrVAi28JEA8KeWTLXwUWio3oYD08uNbCVFFHikpnHz2aHPGqJlUq9HWRzZhOhEO0_C/s1600/next5.jpg" imageanchor="1" style="background-color: white; clear: right; color: #771100; float: right; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; margin-left: 1em; text-align: center; text-decoration: none;"><br /></a><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i><a href="http://www.mediafire.com/?ncss9bb2ut15lny" target="_blank">Click here</a></i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to download this project and import into Eclipse IDE on your machine.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br />
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<b><span style="color: #cc0000;"><br /></span></b><span style="color: #38761d;"><b><i><u>Using highlight command</u><span style="color: #333333;"> </span></i><span style="color: #333333;"> </span>will be explained in the next post.</b></span></div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" imageanchor="1" style="clear: right; color: #771100; float: right; margin-bottom: 1em; margin-left: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" style="border: none; position: relative;" /></a></div>
Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com0tag:blogger.com,1999:blog-2483593764182960323.post-60622807137809009662013-05-13T06:25:00.001-07:002013-05-14T08:26:04.402-07:00146. Using getHTMLSource command<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFyEFTiEyMr9Uwjsrt4UffgdodKBcjZbBZuiTrNNnb21CAGebR-N4BVVieDA2LdPBDrOu3b7hZRak7D41_sTainTa1hHMPNiY6CfkNqiG1MDpiSRnE_6RxGptKkXXf1YSSL5CD9rBrfNlD/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFyEFTiEyMr9Uwjsrt4UffgdodKBcjZbBZuiTrNNnb21CAGebR-N4BVVieDA2LdPBDrOu3b7hZRak7D41_sTainTa1hHMPNiY6CfkNqiG1MDpiSRnE_6RxGptKkXXf1YSSL5CD9rBrfNlD/s1600/PreviousPost2.jpg" /></a></div>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">getHtmlSource</span></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> Selenium RC command retrieves the complete html code of the web page.</span><br />
<br />
View the HTML source of the web page by following the below steps:<br />
<br />
1. Open <a href="http://www.omayo.blogspot.com/" target="_blank">www.omayo.blogspot.com</a> in Firefox Browser<br />
2. Right click on the page and select 'View Page Source' option as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIgca0VREQaHQjVybnyOCwwD2u015ELQDr_UUPxUDlQy9xsl-1z-gIUDBlT-GQcW2q5ABYrrW9tAV03jbh4muBxWP4DgeQs4x6rW47y23MLqp-4qSXBzh1SF25bJPF_RLZ7zqIU8y5ScGZ/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIgca0VREQaHQjVybnyOCwwD2u015ELQDr_UUPxUDlQy9xsl-1z-gIUDBlT-GQcW2q5ABYrrW9tAV03jbh4muBxWP4DgeQs4x6rW47y23MLqp-4qSXBzh1SF25bJPF_RLZ7zqIU8y5ScGZ/s1600/1.jpg" /></a></div>
<br />
<br />
3. Observe that HTML source code of the page is displayed in a separate window as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5TqhR4gRRhz-Npxnd_4PoE2cm8IrcLTjDX4eJMa5S6Qr8JtTxEzwzBJS6G7XvaMI6hz9Ntz7ha42DsfqxcDIELX7M38FwWoxz2zuAznsfx_sw7APXHMu2qZBxF_n0I2z1QZiIMYveXY6f/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5TqhR4gRRhz-Npxnd_4PoE2cm8IrcLTjDX4eJMa5S6Qr8JtTxEzwzBJS6G7XvaMI6hz9Ntz7ha42DsfqxcDIELX7M38FwWoxz2zuAznsfx_sw7APXHMu2qZBxF_n0I2z1QZiIMYveXY6f/s1600/2.jpg" /></a></div>
<br />
<br />
<br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Test Description:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Go through the comments mentioned on the below screenshot to understand the test description that we are going to implement on Eclipse IDE:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh5s1GcwXKGSMYS8zuR_T9MwNBbefjukaoW8KoCfWhsStxNeimL7i_cpP2Ge-qOOc8zqqIwcqIsDE1xVFcgV7YhtzlKnDD6ZyC56BOG-E30va6F4Cnk30-5xQe4to2X4QivSWbffRyNtHS/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh5s1GcwXKGSMYS8zuR_T9MwNBbefjukaoW8KoCfWhsStxNeimL7i_cpP2Ge-qOOc8zqqIwcqIsDE1xVFcgV7YhtzlKnDD6ZyC56BOG-E30va6F4Cnk30-5xQe4to2X4QivSWbffRyNtHS/s1600/3.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Syntax:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">selenium.<b>getHtmlSource( )</b>;</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Lets Implement This:</span></b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;"><br /></span></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Pre-requisites:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Create a new Project say 'RC-Project62' in Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Configure the Project to work with Selenium RC</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. Configure the Selenium Standalone Server to run from Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Create a package say 'package62' under the newly created project.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Create a Java Class file say 'Class62' under the newly created package as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidmqQMqA7FXGmT4Gc3GTztRb8VmL5WpFN3n4ZjMLZGdY5dQfafuXA26RKkqKktDmaNLHVjfuJDBKU5I2x2aUf_bD1sEARtZv_dsELWU_oM8SfwnD4_XgzJGufSHCRFtizNpUBRfrGUYMQL/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidmqQMqA7FXGmT4Gc3GTztRb8VmL5WpFN3n4ZjMLZGdY5dQfafuXA26RKkqKktDmaNLHVjfuJDBKU5I2x2aUf_bD1sEARtZv_dsELWU_oM8SfwnD4_XgzJGufSHCRFtizNpUBRfrGUYMQL/s1600/4.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Actual Steps:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Write the following code into the newly created Java Class file as shown below and make sure that you resolve all the errors before going to next step:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYfxGy-V9hc6fF1LYza4okDZAqR9-rlVS2us-uXQbcg0Pb1zWH8GcVSji0GkvPCnSLek4jNO1bayHY74dYE4rj_HfFK74Z66Qw0NsMeC2HHH_zsWmSXkMtbxx7OhsWzMzql0zaUr9FIZSm/s1600/5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYfxGy-V9hc6fF1LYza4okDZAqR9-rlVS2us-uXQbcg0Pb1zWH8GcVSji0GkvPCnSLek4jNO1bayHY74dYE4rj_HfFK74Z66Qw0NsMeC2HHH_zsWmSXkMtbxx7OhsWzMzql0zaUr9FIZSm/s1600/5.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Write the test method 'getHtmlSourceDemo()' as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmGmr-LerV-bvV2Qiuf4hNwzMl70KySCwl3xO4Q6WHlfs78mDJsGIf1bZht-MqVCYc7XAic5jX2w0rI3ctjGr39kZCW-6GGG6nWse0GtwRagJ-Q_2YKj5EDCsxJT6sr-l8uw8JrOu0Sl9N/s1600/6.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmGmr-LerV-bvV2Qiuf4hNwzMl70KySCwl3xO4Q6WHlfs78mDJsGIf1bZht-MqVCYc7XAic5jX2w0rI3ctjGr39kZCW-6GGG6nWse0GtwRagJ-Q_2YKj5EDCsxJT6sr-l8uw8JrOu0Sl9N/s1600/6.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Use Selenium RC command </span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">getHtmlSource( ) </b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">for retrieving the complete HTML code of the web page and also enter the retrieved code into the text area field using the Selenium RC command <b>type</b> as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0teR2g2ufEl2dQBuuy9xDP_Io6QVyPFhR7FqGDXOVTxMMSH9RA5Rp8AnNfQA0rBR7yL7IaJYpA57L-O2wBIUjihIJFahyPMj8b21kfHf3Kuo244WcInnKEuwgMsAllebY1AwJNb1N-bM5/s1600/7.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0teR2g2ufEl2dQBuuy9xDP_Io6QVyPFhR7FqGDXOVTxMMSH9RA5Rp8AnNfQA0rBR7yL7IaJYpA57L-O2wBIUjihIJFahyPMj8b21kfHf3Kuo244WcInnKEuwgMsAllebY1AwJNb1N-bM5/s1600/7.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Start the Selenium Standalone Server</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Save and Run the 'Class62.java' file by selecting the 'JUnit Test' option and ensure that our Automation Test has retrieved the complete HTML code of the page and also entered the retrieved code into the text area field as</span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> shown in the below video:</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Watch the below video:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<i style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><a href="http://www.youtube.com/watch?v=DCCDnyrYtpY&feature=youtu.be" target="_blank">Click here</a></b></i><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to watch the video.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Download this Project:</span></b><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFQ3ubkmtpiVh9v97qwmRH6Uwyj3F52qlsd57w2zg5S3YCzP80tNIRcOEpTGGcGmDn_GxCbH-PQ_mrVAi28JEA8KeWTLXwUWio3oYD08uNbCVFFHikpnHz2aHPGqJlUq9HWRzZhOhEO0_C/s1600/next5.jpg" imageanchor="1" style="background-color: white; clear: right; color: #771100; float: right; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; margin-left: 1em; text-align: center; text-decoration: none;"><br /></a><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i><a href="http://www.mediafire.com/?kv4u67nr4j5ybpf" target="_blank">Click here</a></i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to download this project and import into Eclipse IDE on your machine.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br />
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<b><span style="color: #cc0000;"><br /></span></b><span style="color: #38761d;"><b><i><u>Using goBack command</u><span style="color: #333333;"> </span></i><span style="color: #333333;"> </span>will be explained in the next post.</b></span></div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" imageanchor="1" style="clear: right; color: #771100; float: right; margin-bottom: 1em; margin-left: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" style="border: none; position: relative;" /></a></div>
Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com0tag:blogger.com,1999:blog-2483593764182960323.post-44304150636397574912013-05-13T05:53:00.000-07:002013-05-14T01:37:30.421-07:00145. Using getBodyText command<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-9rp4HiBIzhcjj70q8swpQYKNHFrdFMm5ja7wrdvQriNQqFO3d5wASozpj-yjnINRBcrtAsXljEvq7ANhYumS9NEciNdhMy3r-PEWffSMeQXwGRQcfORASV6sF7h6VmfUINuMRlPD32uQ/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-9rp4HiBIzhcjj70q8swpQYKNHFrdFMm5ja7wrdvQriNQqFO3d5wASozpj-yjnINRBcrtAsXljEvq7ANhYumS9NEciNdhMy3r-PEWffSMeQXwGRQcfORASV6sF7h6VmfUINuMRlPD32uQ/s1600/PreviousPost2.jpg" /></a></div>
<br />
<br />
<br />
<b><span style="color: #cc0000;"><br /></span></b>
<b><span style="color: #cc0000;"><br /></span></b>
<b><span style="color: #cc0000;">getBodyText</span></b> Selenium RC command retrieves the complete text on the web page.<br />
<br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Test Description:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Go through the comments mentioned on the below screenshot to understand the test description that we are going to implement on Eclipse IDE:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlLasgJASlVWRixg59ogsIqPuHZ4q4bAA_ofB29U1Qgk8y0WiuV1s5RbgQXHrNFuK0ZTKke-QV4hFv2XyDKZamARWR2g-4B5s1nKGxAFRjE67SvoyrWTd-hIk_mGHeJEO9_m0JuYIDftqB/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="546" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlLasgJASlVWRixg59ogsIqPuHZ4q4bAA_ofB29U1Qgk8y0WiuV1s5RbgQXHrNFuK0ZTKke-QV4hFv2XyDKZamARWR2g-4B5s1nKGxAFRjE67SvoyrWTd-hIk_mGHeJEO9_m0JuYIDftqB/s640/1.jpg" width="640" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Syntax:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">selenium.<b>getBodyText( )</b>;</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Lets Implement This:</span></b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;"><br /></span></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Pre-requisites:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Create a new Project say 'RC-Project61' in Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Configure the Project to work with Selenium RC</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. Configure the Selenium Standalone Server to run from Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Create a package say 'package61' under the newly created project.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Create a Java Class file say 'Class61' under the newly created package as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheIJpOPi5TrvHLeLU51OVMrwCqvK356LFI1AX03OqOQi9w209E_rL64noVQwbCaRkg4zMhHaPgXV7JGpe4p6_0SskXEP7tjoHjZmzt3VuEMGZsTqh4yrl_uTzKSLihpj88lC3UMWVUPQ48/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheIJpOPi5TrvHLeLU51OVMrwCqvK356LFI1AX03OqOQi9w209E_rL64noVQwbCaRkg4zMhHaPgXV7JGpe4p6_0SskXEP7tjoHjZmzt3VuEMGZsTqh4yrl_uTzKSLihpj88lC3UMWVUPQ48/s1600/2.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Actual Steps:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Write the following code into the newly created Java Class file as shown below and make sure that you resolve all the errors before going to next step:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtprZVdhraFHa6rT8Q7wRJW7wDyJtUmx_-8npIZ1vjYTlNPETpFqF3FFATlKMjjeR1fpdt4W-m9BsJRHKOfYgHJCIhqq3VIK2W810-pquGFWrda4TeFdYUEjPgWXaJ2oS5cSuTvGfFeGb4/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtprZVdhraFHa6rT8Q7wRJW7wDyJtUmx_-8npIZ1vjYTlNPETpFqF3FFATlKMjjeR1fpdt4W-m9BsJRHKOfYgHJCIhqq3VIK2W810-pquGFWrda4TeFdYUEjPgWXaJ2oS5cSuTvGfFeGb4/s1600/2.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Write the test method 'getBodyTextDemo()' as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNXggbCoAnUuL-CwLGVe8G_CiM5AyPTP6AwgdKNVi2C9QgWiZ5hEdxMlRqYz43kyQAlQKshzoFQNLNtCVAeXbyiQYOzm_Okix_npVr3dhCrwpiN3UnLVTCEOdj3ySHPEYFCE7UNMb4-AaG/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNXggbCoAnUuL-CwLGVe8G_CiM5AyPTP6AwgdKNVi2C9QgWiZ5hEdxMlRqYz43kyQAlQKshzoFQNLNtCVAeXbyiQYOzm_Okix_npVr3dhCrwpiN3UnLVTCEOdj3ySHPEYFCE7UNMb4-AaG/s1600/4.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Use Selenium RC command </span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">getBodyText( ) </b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">for retrieving the complete text on the web page and also enter the retrieved text into the text area field using the Selenium RC command <b>type</b> as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRdnnmxswkNBHu9T8MJLVT43n5G_-OCWO4z_nlAcqqSNcpcCQtiDQQdI1kzPqyGC_TP-_Cv35mxEcxt9MzmHApLCJDWdq5nIbrarEEsrO022SvmD92BzHOSNbm7nWdmI2vAGXKccPxB3sQ/s1600/5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRdnnmxswkNBHu9T8MJLVT43n5G_-OCWO4z_nlAcqqSNcpcCQtiDQQdI1kzPqyGC_TP-_Cv35mxEcxt9MzmHApLCJDWdq5nIbrarEEsrO022SvmD92BzHOSNbm7nWdmI2vAGXKccPxB3sQ/s1600/5.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Start the Selenium Standalone Server</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Save and Run the 'Class61.java' file by selecting the 'JUnit Test' option and ensure that our Automation Test has retrieved the complete text on the page and also entered the retrieved text into the text area field as</span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> shown in the below video:</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Watch the below video:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<i style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><a href="http://www.youtube.com/watch?v=kIBbM1eZO8k&feature=youtu.be" target="_blank">Click here</a></b></i><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to watch the video.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Download this Project:</span></b><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFQ3ubkmtpiVh9v97qwmRH6Uwyj3F52qlsd57w2zg5S3YCzP80tNIRcOEpTGGcGmDn_GxCbH-PQ_mrVAi28JEA8KeWTLXwUWio3oYD08uNbCVFFHikpnHz2aHPGqJlUq9HWRzZhOhEO0_C/s1600/next5.jpg" imageanchor="1" style="background-color: white; clear: right; color: #771100; float: right; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; margin-left: 1em; text-align: center; text-decoration: none;"><br /></a><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i><a href="http://www.mediafire.com/?p7963hh29pxd794" target="_blank">Click here</a></i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to download this project and import into Eclipse IDE on your machine.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> </span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br />
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<b><span style="color: #cc0000;"><br /></span></b><span style="color: #38761d;"><b><i><u>Using getHTMLSource command</u><span style="color: #333333;"> </span></i><span style="color: #333333;"> </span>will be explained in the next post.</b></span></div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" imageanchor="1" style="clear: right; color: #771100; float: right; margin-bottom: 1em; margin-left: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" style="border: none; position: relative;" /></a></div>
<br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com0tag:blogger.com,1999:blog-2483593764182960323.post-19827574160085183042013-05-13T03:29:00.001-07:002013-05-14T01:01:21.073-07:00144. Using getXpathCount command<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiE4XcIs_Yh9aQEqp_cFWoP7dvLnCtQ16XbA_f_XEbHAfggMlIHmRCW4MT5CYEvyBscpPiW164t6tcA0Y_ry0QHo-ffDQpQinkCRj1g_r3KbraGNAybBGLXx_tBy1dGJM6HWIp2Qf4e-wGa/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiE4XcIs_Yh9aQEqp_cFWoP7dvLnCtQ16XbA_f_XEbHAfggMlIHmRCW4MT5CYEvyBscpPiW164t6tcA0Y_ry0QHo-ffDQpQinkCRj1g_r3KbraGNAybBGLXx_tBy1dGJM6HWIp2Qf4e-wGa/s1600/PreviousPost2.jpg" /></a></div>
<br />
<br />
<br />
<br />
<br />
XPath statement can be used to locate more than one element. In order to retrieve the number of elements located by a single XPath statement, we have to use <b>getXpathCount</b> Selenium RC command.<br />
<br />
<b><span style="color: blue;">So lets find an XPath statement which locates more than one element by following the below steps:</span></b><br />
<br />
1. Open <a href="http://omayo.blogspot.in/">http://omayo.blogspot.in/</a> in Firefox Browser<br />
2. In 'Firepath' tab, select XPath option and enter the XPath statement <b><span style="color: #cc0000;">//option</span></b> into the text box field as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbnvlGqWr8G9N2MjeN_curInbX5mKS1JqYXyy_AqoTbr59RIMSfVR6k8aPxDDLcNPnyeltFpz6y7feyMUCcihil2M515ecy_E3-EZm_6PbONKTcr9MGyWRUgCC88Ljanmd2Ccdi2BatwQ9/s1600/8.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbnvlGqWr8G9N2MjeN_curInbX5mKS1JqYXyy_AqoTbr59RIMSfVR6k8aPxDDLcNPnyeltFpz6y7feyMUCcihil2M515ecy_E3-EZm_6PbONKTcr9MGyWRUgCC88Ljanmd2Ccdi2BatwQ9/s1600/8.jpg" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
3. So the XPath Statement<span style="color: #cc0000;"> <b>//option</b></span> can locate more than one element (i.e. all the list options in the drop down field)<br />
<br />
<b><span style="color: blue;">Test Description:</span></b><br />
<br />
Go through the comments mentioned on the below screenshot to understand the test description that we are going to implement on Eclipse IDE:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkGdX1rN75jSHNjnRyZIk9BP1beK0Hq5ZpfK5LZ0s2znYfWMn6mnLKd-VEWfoFTec9OgBj-Ox7q_je3W5yjgUmcILgCLymHM6IeUThi1t-uWbnroMC-7LmVOCh3HvPnBsHz5mA-_XoleA8/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="384" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkGdX1rN75jSHNjnRyZIk9BP1beK0Hq5ZpfK5LZ0s2znYfWMn6mnLKd-VEWfoFTec9OgBj-Ox7q_je3W5yjgUmcILgCLymHM6IeUThi1t-uWbnroMC-7LmVOCh3HvPnBsHz5mA-_XoleA8/s640/2.jpg" width="640" /></a></div>
<br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Syntax:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">getXpathCount("XPath Statement");</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Lets Implement This:</span></b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;"><br /></span></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Pre-requisites:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Create a new Project say 'RC-Project60' in Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Configure the Project to work with Selenium RC</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. Configure the Selenium Standalone Server to run from Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Create a package say 'package60' under the newly created project.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Create a Java Class file say 'Class60' under the newly created package as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhijKtvJIXQukYqtwzC01n3y8RArvepD7gvl7jNefv9zyXY7GRH_j6k2qX0GjUrTEOIYgn_DyvBz5FuLoCX5C8BHXk7n0s9f8zNhIeya16b_rFVlWbMcFqMYH_mPlCJmAoncimVxy1mimRg/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhijKtvJIXQukYqtwzC01n3y8RArvepD7gvl7jNefv9zyXY7GRH_j6k2qX0GjUrTEOIYgn_DyvBz5FuLoCX5C8BHXk7n0s9f8zNhIeya16b_rFVlWbMcFqMYH_mPlCJmAoncimVxy1mimRg/s1600/3.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Actual Steps:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Write the following code into the newly created Java Class file as shown below and make sure that you resolve all the errors before going to next step:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtZvbZZAJQ8MibDtYug44NEQYoEAHRhxnsz_nyBYYdL2cs1ueZ8C31yV6hw44lfqpE3pOWWedpH57Kyuv9i76r1e6Y-J0vAUqRBuiuhRjtsnhpEUvWJNKvtkLE1p0OgWx4fnS9h-3Qw8Is/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtZvbZZAJQ8MibDtYug44NEQYoEAHRhxnsz_nyBYYdL2cs1ueZ8C31yV6hw44lfqpE3pOWWedpH57Kyuv9i76r1e6Y-J0vAUqRBuiuhRjtsnhpEUvWJNKvtkLE1p0OgWx4fnS9h-3Qw8Is/s1600/4.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Write the test method 'getXpathCountDemo()' as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHB8OjwacFzWam2fYmHYt-6H95MdR8WVRhdFCzS8zKmLQZKJyx0YET1b12uN4IkUoXkohsP2NaQYUlCxsobtnpnoOeuXR9nQbQ9owSDV_gS-tcel_Q0sDiJSF-ivEpbqMJ0Q92qq9kgdiK/s1600/5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHB8OjwacFzWam2fYmHYt-6H95MdR8WVRhdFCzS8zKmLQZKJyx0YET1b12uN4IkUoXkohsP2NaQYUlCxsobtnpnoOeuXR9nQbQ9owSDV_gS-tcel_Q0sDiJSF-ivEpbqMJ0Q92qq9kgdiK/s1600/5.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Use Selenium RC command </span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">getXPathCount( ) </b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">for retrieving the count of the list options available in the drop down field and also enter the retrieved count into the text area field using the Selenium RC command <b>type</b> as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNAfa-bJZXJaN1ZmtRNrE3dMtzL3UnUH4SQf4IEIpje9DG9Qc-Ygp4Jm0DeQ29MiMYp8ddSRKkoQEbv37DwIoIlBY3rfS1l2xDLhXotla5meFtoL7a4aXTPG_sYy_Dkstn6CZOKKPIsSxp/s1600/7.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNAfa-bJZXJaN1ZmtRNrE3dMtzL3UnUH4SQf4IEIpje9DG9Qc-Ygp4Jm0DeQ29MiMYp8ddSRKkoQEbv37DwIoIlBY3rfS1l2xDLhXotla5meFtoL7a4aXTPG_sYy_Dkstn6CZOKKPIsSxp/s1600/7.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><i><u>Note</u></i></b> - <b>intValue( )</b> Java method is used in this example to convert the number returned by the <b>getXpathCount</b> Selenium RC command to an integer value.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Start the Selenium Standalone Server</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Save and Run the 'Class60.java' file by selecting the 'JUnit Test' option and ensure that our Automation Test has retrieved the count of list options in the drop down field using getXpathCount command, converted the count into the integer value using intValue( ) Java method and entered the converted count into the text area field using type Selenium RC command as</span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> shown in the below video:</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Watch the below video:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<i style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><a href="http://www.youtube.com/watch?v=FOP5sFSvtsg&feature=youtu.be" target="_blank">Click here</a></b></i><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to watch the video.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Download this Project:</span></b><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFQ3ubkmtpiVh9v97qwmRH6Uwyj3F52qlsd57w2zg5S3YCzP80tNIRcOEpTGGcGmDn_GxCbH-PQ_mrVAi28JEA8KeWTLXwUWio3oYD08uNbCVFFHikpnHz2aHPGqJlUq9HWRzZhOhEO0_C/s1600/next5.jpg" imageanchor="1" style="background-color: white; clear: right; color: #771100; float: right; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; margin-left: 1em; text-align: center; text-decoration: none;"><br /></a><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i><a href="http://www.mediafire.com/?rvmystwrc2yrram" target="_blank">Click here</a></i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to download this project and import into Eclipse IDE on your machine.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> </span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br />
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<b><span style="color: #cc0000;"><br /></span></b><span style="color: #38761d;"><b><i><u>Using getBodyText command</u><span style="color: #333333;"> </span></i><span style="color: #333333;"> </span>will be explained in the next post.</b></span></div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" imageanchor="1" style="clear: right; color: #771100; float: right; margin-bottom: 1em; margin-left: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" style="border: none; position: relative;" /></a></div>
Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com0tag:blogger.com,1999:blog-2483593764182960323.post-90922607520409318172013-05-12T21:47:00.001-07:002013-05-13T02:36:54.901-07:00143. Using isElementPresent command<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4DD72tZxhXJFcb0XRXqu_h2rTyL3Qx6azu3zJUdsQmnANiz5ZsaC9YFM6LO-Zy7CBWTKc3MBUVVVSdwf-eClLXkrT5k2XQQYcfe61HbOw-54uXWKDKbkl_NWGC3IZK2w934l-8AoSEile/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4DD72tZxhXJFcb0XRXqu_h2rTyL3Qx6azu3zJUdsQmnANiz5ZsaC9YFM6LO-Zy7CBWTKc3MBUVVVSdwf-eClLXkrT5k2XQQYcfe61HbOw-54uXWKDKbkl_NWGC3IZK2w934l-8AoSEile/s1600/PreviousPost2.jpg" /></a></div>
<br />
<br />
<br />
<br />
<br />
Selenium RC command <b>isElementPresent</b> works similar to the <b>isTextPresent</b> command. But <b>isElementPresent</b> can be used to verify whether any element on the page like heading text, drop down field, text fields, radio buttons, check box options etc<br />
<br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Test Description:</b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">First of all lets understand the Test Description by going through the comments mentioned on the below screenshot.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDL209VZwa1TfTLsXxafJ0xfMe9rbPgOz7pOdVwLnoMOgTcP7m5puauE6OquKaJ1AprU91kwWFN9KW4Dx12JQXuZE0dryrfFLkIIA4sBgJKhkI_mv-EGEqVGfQNZX7uL0Ka5wba6Q_NopL/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDL209VZwa1TfTLsXxafJ0xfMe9rbPgOz7pOdVwLnoMOgTcP7m5puauE6OquKaJ1AprU91kwWFN9KW4Dx12JQXuZE0dryrfFLkIIA4sBgJKhkI_mv-EGEqVGfQNZX7uL0Ka5wba6Q_NopL/s1600/1.jpg" /></a></div>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Syntax:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">isElementPresent("CSS path for locating the element");</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Lets Implement This:</span></b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Pre-requisites:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Create a new Project say 'RC-Project59' in Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Configure the Project to work with Selenium RC</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. Configure the Selenium Standalone Server to run from Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Create a package say 'package59' under the newly created project.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Create a Java Class file say 'Class59' under the newly created package as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiE-GigmSq4c8YP92enQG9umn_pFGZV0WQy6Xy_afOkGyOCVQRd_dldeigaagV8apnerzd1OVkNRmLO_jbu2zJgSzHqJXlcXNm6qpphI43os4ynrT7Jr37n66KTJ63SUDvxt8P81eV_atkz/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiE-GigmSq4c8YP92enQG9umn_pFGZV0WQy6Xy_afOkGyOCVQRd_dldeigaagV8apnerzd1OVkNRmLO_jbu2zJgSzHqJXlcXNm6qpphI43os4ynrT7Jr37n66KTJ63SUDvxt8P81eV_atkz/s1600/2.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Actual Steps:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Write the following code into the newly created Java Class file as shown below and make sure that you resolve all the errors before going to next step:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVLkaF7MB9GOfcsCLG9mFNdEYrAOiEK7QMy70EOlw0CUnB4mB4hcEOrasB5fOElLtbVSoITBwvbLxH91AdyPKMB2CIch-uYUjeQu7yERPF5DeZmqkrKhvGCNm1-Nv4PIjHGfF6Y7_4qhFX/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVLkaF7MB9GOfcsCLG9mFNdEYrAOiEK7QMy70EOlw0CUnB4mB4hcEOrasB5fOElLtbVSoITBwvbLxH91AdyPKMB2CIch-uYUjeQu7yERPF5DeZmqkrKhvGCNm1-Nv4PIjHGfF6Y7_4qhFX/s1600/3.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Write the test method 'isElementPresentDemo()' as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2FVldgOws2T9skbygS4Qe5TVbt38rkS_hv91u6BWfVYhdmHNiARrAeFBJaS26jI7fS4lowygh5ksetTq5gPpmRZNPM7sbNg4cDaUgUO8X9HxI9Gry170AGvgVx1bABvofqHezooHBWXHC/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2FVldgOws2T9skbygS4Qe5TVbt38rkS_hv91u6BWfVYhdmHNiARrAeFBJaS26jI7fS4lowygh5ksetTq5gPpmRZNPM7sbNg4cDaUgUO8X9HxI9Gry170AGvgVx1bABvofqHezooHBWXHC/s1600/4.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Use Selenium RC command </span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">isElementPresent( ) </b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">for verifying whether the drop box field element is present on the page of the website and use Selenium RC command select to select 'doc 4' list option if the drop box field element is present on the page</span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqxcdoVLQYO1VpQrJTS31FPGLNQlguMMNBeXTcmrIEUOqxPWI1k3ylZrmVzQDAgOWoJFFJ8XRoOUrXfLSPdxKHB2MqFbma5kvlGcTif7A3VwbgVsId-x0WhLKgfXUVgO4vJ-5E3gaeY1fW/s1600/5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqxcdoVLQYO1VpQrJTS31FPGLNQlguMMNBeXTcmrIEUOqxPWI1k3ylZrmVzQDAgOWoJFFJ8XRoOUrXfLSPdxKHB2MqFbma5kvlGcTif7A3VwbgVsId-x0WhLKgfXUVgO4vJ-5E3gaeY1fW/s1600/5.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Start the Selenium Standalone Server</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Save and Run the 'Class59.java' file by selecting the 'JUnit Test' option and ensure that our Automation Test has selected the 'doc 4' list option from the drop down field to confirm that the the drop down field element specified in the Selenium RC command<b> isElementPresent</b> is present on the web page</span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> as shown in the below video:</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Watch the below video:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<i style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><a href="http://www.youtube.com/watch?v=9HvTCgAnkuM&feature=youtu.be" target="_blank">Click here</a></b></i><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to watch the video.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Download this Project:</span></b><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFQ3ubkmtpiVh9v97qwmRH6Uwyj3F52qlsd57w2zg5S3YCzP80tNIRcOEpTGGcGmDn_GxCbH-PQ_mrVAi28JEA8KeWTLXwUWio3oYD08uNbCVFFHikpnHz2aHPGqJlUq9HWRzZhOhEO0_C/s1600/next5.jpg" imageanchor="1" style="background-color: white; clear: right; color: #771100; float: right; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; margin-left: 1em; text-align: center; text-decoration: none;"><br /></a><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i><a href="http://www.mediafire.com/?tb1zuhzw1ik61eb" target="_blank">Click here</a></i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to download this project and import into Eclipse IDE on your machine.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> </span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br />
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<b><span style="color: #cc0000;"><br /></span></b><span style="color: #38761d;"><b><i><u>Using getXPathCount command</u><span style="color: #333333;"> </span></i><span style="color: #333333;"> </span>will be explained in the next post.</b></span></div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" imageanchor="1" style="clear: right; color: #771100; float: right; margin-bottom: 1em; margin-left: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" style="border: none; position: relative;" /></a></div>
Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com0tag:blogger.com,1999:blog-2483593764182960323.post-50485241878804934772013-05-12T00:36:00.003-07:002013-05-12T23:55:55.354-07:00142. Using isTextPresent command<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0dplPo1QFTmUMLXMeEN-kqo_Loc0U6hRHM8N6yG-PumGULFJn5a5hGveoFIZEXEiCKD33-5pfLWRhA6l94B546deR8SERGxG2YVPirl0sRnHC4BctdL9xfqaK7c5mLURhPJBaA09-OSGl/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0dplPo1QFTmUMLXMeEN-kqo_Loc0U6hRHM8N6yG-PumGULFJn5a5hGveoFIZEXEiCKD33-5pfLWRhA6l94B546deR8SERGxG2YVPirl0sRnHC4BctdL9xfqaK7c5mLURhPJBaA09-OSGl/s1600/PreviousPost2.jpg" /></a></div>
<br />
<br />
<br />
<br />
We have already discussed about this method in our previous post <a href="http://seleniumone-by-arun.blogspot.in/2013/04/29-using-istextpresent-method-to-verify.html" target="_blank">Post# 38 Using isTextPresent command to verify whether the text is present on the page</a>. Go through the <a href="http://seleniumone-by-arun.blogspot.in/2013/04/29-using-istextpresent-method-to-verify.html" target="_blank">Post # 38</a> once and now lets implement this command in a different scenario.<br />
<br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Test Description:</b><br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">First of all lets understand the Test Description by going through the comments mentioned on the below screenshot.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-QHHjN9f-eZ5VSawsYqh9MGNG2g886Hyda_5E-XYU2ESgvWzCAXo95Rlt5AL_DWTkpdFvdGsbVXXnVjNqHgycPs5TTpL2-p5OkZ2ddTqYgzM7hZdSoixcUYM4Y6xG6fh84bfwu1HWto_E/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-QHHjN9f-eZ5VSawsYqh9MGNG2g886Hyda_5E-XYU2ESgvWzCAXo95Rlt5AL_DWTkpdFvdGsbVXXnVjNqHgycPs5TTpL2-p5OkZ2ddTqYgzM7hZdSoixcUYM4Y6xG6fh84bfwu1HWto_E/s1600/1.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><br /></b></span>
<b><span style="color: blue;">Syntax:</span></b><br />
<br />
isTextPresent("Text present on the web page");<br />
<br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Lets Implement This:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Pre-requisites:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Create a new Project say 'RC-Project58' in Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Configure the Project to work with Selenium RC</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. Configure the Selenium Standalone Server to run from Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Create a package say 'package58' under the newly created project.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Create a Java Class file say 'Class58' under the newly created package as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKVmeNNflWEJEy3Rvu4WykGeoZdTIAMOJRjau9LVzUlR2ZmaRrd34Biyrhm2gKM8YVyAiqDg1EuWQgN9fPC0ye2pFr2oAqSfZJMBjgppA4mJO89IrJJ4sPdA2zAJLCxTuCPcB_WLSgJf9f/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKVmeNNflWEJEy3Rvu4WykGeoZdTIAMOJRjau9LVzUlR2ZmaRrd34Biyrhm2gKM8YVyAiqDg1EuWQgN9fPC0ye2pFr2oAqSfZJMBjgppA4mJO89IrJJ4sPdA2zAJLCxTuCPcB_WLSgJf9f/s1600/2.jpg" /></a></div>
<br />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Actual Steps:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Write the following code into the newly created Java Class file as shown below and make sure that you resolve all the errors before going to next step:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC5yySN2K4YuCp4XE5WhUTLsWRnZxzUB1ej6W6gx1MaG8Vie9fZTuIMuq4999RE_4YUsIAby4XALL6CNVMNlYb69iS7JSAZwNbNNQRm4fhVKcta-EcCvTD0zHVQBCqrBoS1wiyxisWiHXM/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC5yySN2K4YuCp4XE5WhUTLsWRnZxzUB1ej6W6gx1MaG8Vie9fZTuIMuq4999RE_4YUsIAby4XALL6CNVMNlYb69iS7JSAZwNbNNQRm4fhVKcta-EcCvTD0zHVQBCqrBoS1wiyxisWiHXM/s1600/3.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Write the test method 'isTextPresentDemo()' as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhc4UGi3i0xCSRM3YnzZ9kqC0A0IyRnLoepPswYSyDAjOy7l0S1v5AYIetf0-UVtF6nawX1ZWz0BFY5PAHhspagHdubAime28gvbNasAVCXpOK214LDaPUcRhhSkw7FicO6p1jGSQT6Jbhf/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhc4UGi3i0xCSRM3YnzZ9kqC0A0IyRnLoepPswYSyDAjOy7l0S1v5AYIetf0-UVtF6nawX1ZWz0BFY5PAHhspagHdubAime28gvbNasAVCXpOK214LDaPUcRhhSkw7FicO6p1jGSQT6Jbhf/s1600/4.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Use Selenium RC command </span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">isTextPresent( ) </b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">for verifying whether the heading element text is present on the page (i.e. 'omayo' text in this example) of the website and use Selenium RC command select to select 'doc 4' list option if the heading element text is present on the page</span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXKmPAi2YiFHdaooxokbdc6v3IpKaBpO1fXeU3TJleOZq9JSXvtvYPceebRgAj56It7Oqep7Ev7wE_ON0esxuEwRu2iDBmRIBVdFLrE1CVkry87l2dPOVJkujV_Dx2cy_fZ_23JJ2gT-zk/s1600/5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXKmPAi2YiFHdaooxokbdc6v3IpKaBpO1fXeU3TJleOZq9JSXvtvYPceebRgAj56It7Oqep7Ev7wE_ON0esxuEwRu2iDBmRIBVdFLrE1CVkry87l2dPOVJkujV_Dx2cy_fZ_23JJ2gT-zk/s1600/5.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Start the Selenium Standalone Server</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Save and Run the 'Class58.java' file by selecting the 'JUnit Test' option and ensure that our Automation Test has selected the 'doc 4' list option from the drop down field to confirm that the specified text in the Selenium RC command<b> isTextPresent</b> is present on the web page</span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> as shown in the below video:</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Watch the below video:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<i style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><a href="http://www.youtube.com/watch?v=pp18svz2cOo&feature=youtu.be" target="_blank">Click here</a></b></i><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to watch the video.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Download this Project:</span></b><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFQ3ubkmtpiVh9v97qwmRH6Uwyj3F52qlsd57w2zg5S3YCzP80tNIRcOEpTGGcGmDn_GxCbH-PQ_mrVAi28JEA8KeWTLXwUWio3oYD08uNbCVFFHikpnHz2aHPGqJlUq9HWRzZhOhEO0_C/s1600/next5.jpg" imageanchor="1" style="background-color: white; clear: right; color: #771100; float: right; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; margin-left: 1em; text-align: center; text-decoration: none;"><br /></a><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i><a href="http://www.mediafire.com/?38cx0jy7j4j25ym" target="_blank">Click here</a></i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to download this project and import into Eclipse IDE on your machine.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> </span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br />
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<b><span style="color: #cc0000;"><br /></span></b><span style="color: #38761d;"><b><i><u>Using isElementPresent command</u><span style="color: #333333;"> </span></i><span style="color: #333333;"> </span>will be explained in the next post.</b></span></div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" imageanchor="1" style="clear: right; color: #771100; float: right; margin-bottom: 1em; margin-left: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" style="border: none; position: relative;" /></a></div>
<br />
<br />Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com0tag:blogger.com,1999:blog-2483593764182960323.post-76338925528659549602013-05-11T11:30:00.002-07:002013-05-11T21:27:56.763-07:00141. Using getText command<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtaF-u1od_BaY_wYcq7vjw-R3utC2aDihmARHnmErIjAZG01qf6Dbxj5cDjToxBai8K7dra62Zwo3PnRCfYM8KLomZ38MHnemcE9Pi7avLmFaM6dDnkzMkXIg2IJT6XSQ7K95SQqh3lghs/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtaF-u1od_BaY_wYcq7vjw-R3utC2aDihmARHnmErIjAZG01qf6Dbxj5cDjToxBai8K7dra62Zwo3PnRCfYM8KLomZ38MHnemcE9Pi7avLmFaM6dDnkzMkXIg2IJT6XSQ7K95SQqh3lghs/s1600/PreviousPost2.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">We've already discussed about this method in our earlier post </span><a href="http://seleniumone-by-arun.blogspot.in/2013/04/109-using-gettext-predefined-method-to.html" target="_blank">Post # 109 Using getText( ) method to retrieve the elements text</a><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">. Go through the </span><a href="http://seleniumone-by-arun.blogspot.in/2013/04/109-using-gettext-predefined-method-to.html" target="_blank">Post #41</a><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> once and now lets use the assertEquals( ) JUnit method to verify whether retrieved text is equal to the actual text.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><span style="color: blue;">Syntax:</span></b></span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #333333;">assertEquals("Retrieved text is not the same", "omayo", selenium.</span><b><span style="color: #990000;">getText("CSS path for locating the text element")</span></b><span style="color: #333333;"> );</span></span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<b style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Test Description:</b><br />
<b style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></b>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">First of all lets understand the Test Description by going through the comments mentioned on the below screenshot.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizfRAHhBKF97CPLXHWIsY_MtKVBXvQjsUqch_aQViDSeq3LMN8rKwsnCR-5B9ByvafEsiag4Aob5p7GzQ9N4IHd5KfmrxXn14YEh18wUQgtqn1ttjNXDWikq4wQ7JYlB_2CAACPwPHYFGy/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizfRAHhBKF97CPLXHWIsY_MtKVBXvQjsUqch_aQViDSeq3LMN8rKwsnCR-5B9ByvafEsiag4Aob5p7GzQ9N4IHd5KfmrxXn14YEh18wUQgtqn1ttjNXDWikq4wQ7JYlB_2CAACPwPHYFGy/s1600/1.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">So we have to locate the heading elements text using CSS path, as we have to use the CSS path in the getText command for retrieving its text.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Lets Implement This:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Pre-requisites:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Create a new Project say 'RC-Project57' in Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Configure the Project to work with Selenium RC</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. Configure the Selenium Standalone Server to run from Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Create a package say 'package57' under the newly created project.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Create a Java Class file say 'Class57' under the newly created package as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLp7zL2tuoxUOUV0R8kUdP3usLWqeTKiONQZCZkPGKUpr5fZhzAw-qAok9ySRP4TRVlu0BuNyBf0COIkbOdJ52Q4RyNvHqYHJzkj4aMenY_OzqykSTADBuQRT1DvlzhjtR2OxweWaS4qU7/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLp7zL2tuoxUOUV0R8kUdP3usLWqeTKiONQZCZkPGKUpr5fZhzAw-qAok9ySRP4TRVlu0BuNyBf0COIkbOdJ52Q4RyNvHqYHJzkj4aMenY_OzqykSTADBuQRT1DvlzhjtR2OxweWaS4qU7/s1600/2.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Actual Steps:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Write the following code into the newly created Java Class file as shown below and make sure that you resolve all the errors before going to next step:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFLMEjEvkj5EC61zpYKJ6qKHiNfELTAfDaEtDAVaZdK1aScE0uYaLt4lHE1a9h3Uu-cOOUf6YsIAIX1swKpws1hda79l_cu1OuaC6NqPQ_FuWXzw1oVgDUbLK-0CZdyyKR-HPYjjz57twa/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFLMEjEvkj5EC61zpYKJ6qKHiNfELTAfDaEtDAVaZdK1aScE0uYaLt4lHE1a9h3Uu-cOOUf6YsIAIX1swKpws1hda79l_cu1OuaC6NqPQ_FuWXzw1oVgDUbLK-0CZdyyKR-HPYjjz57twa/s1600/3.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Write the test method 'getTextDemo()' as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsKy4g4Ti0ALVt0MeZx52wP-ZHfIwmdZq-PLzt8gJV-_VhArsFL9pRNz8Sbd7wZC2n-rXlAkq7ct0wSNgmsyF_ZSUOfsfPmE1_XMVCyq-XmNk-piwtRZSplIkgzRpijr8wq_QON-w90V6P/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsKy4g4Ti0ALVt0MeZx52wP-ZHfIwmdZq-PLzt8gJV-_VhArsFL9pRNz8Sbd7wZC2n-rXlAkq7ct0wSNgmsyF_ZSUOfsfPmE1_XMVCyq-XmNk-piwtRZSplIkgzRpijr8wq_QON-w90V6P/s1600/4.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. </span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Use Selenium RC command </span><b style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">getText( ) </b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">for retrieving the text of the heading text element on the page (i.e. 'omayo' text in this example) of the website and use </span><b style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">assertEquals( )</b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> JUnit method for verifying whether the text retrieved is equal to the actual text as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz2cwQ-dhVVvZ8ldo6WZZoT2rEZQhE7xq-TSxRClBERQczPSi8koNwTJetOMgcEWAFZCWMaUxoG02FBOKjKI1QDqPUgPuf2xttDKPorbM6GebigLHBqsYgX4vIUKvVUOw85PxqvEsZUwWG/s1600/5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz2cwQ-dhVVvZ8ldo6WZZoT2rEZQhE7xq-TSxRClBERQczPSi8koNwTJetOMgcEWAFZCWMaUxoG02FBOKjKI1QDqPUgPuf2xttDKPorbM6GebigLHBqsYgX4vIUKvVUOw85PxqvEsZUwWG/s1600/5.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Start the Selenium Standalone Server</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Save and Run the 'Class57.java' file by selecting the 'JUnit Test' option and ensure that our Automation Test has passed to confirm that the text on the web page is equal to the text that</span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> is retrieved using the getText Selenium RC command as shown in the below video:</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Watch the below video:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<i style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><a href="http://www.youtube.com/watch?v=qac4PLmlcts&feature=youtu.be" target="_blank">Click here</a></b></i><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to watch the video.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Download this Project:</span></b><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFQ3ubkmtpiVh9v97qwmRH6Uwyj3F52qlsd57w2zg5S3YCzP80tNIRcOEpTGGcGmDn_GxCbH-PQ_mrVAi28JEA8KeWTLXwUWio3oYD08uNbCVFFHikpnHz2aHPGqJlUq9HWRzZhOhEO0_C/s1600/next5.jpg" imageanchor="1" style="background-color: white; clear: right; color: #771100; float: right; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; margin-left: 1em; text-align: center; text-decoration: none;"><br /></a><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i><a href="http://www.mediafire.com/?tzc4znxwbz7xc1g" target="_blank">Click here</a></i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to download this project and import into Eclipse IDE on your machine.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> </span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br />
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<b><span style="color: #cc0000;"><br /></span></b><span style="color: #38761d;"><b><i><u>Using isTextPresent command</u><span style="color: #333333;"> </span></i><span style="color: #333333;"> </span>will be explained in the next post.</b></span></div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" imageanchor="1" style="clear: right; color: #771100; float: right; margin-bottom: 1em; margin-left: 1em; text-decoration: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" style="border: none; position: relative;" /></a></div>
Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com0tag:blogger.com,1999:blog-2483593764182960323.post-82613771068489174312013-05-11T03:48:00.001-07:002013-05-11T11:30:47.332-07:00140. Using getTitle Method<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjilYfk7YnxuSo4ddxIqzXGfp92DZ3JEsue-8iXu0kh3XJiF6LQsGvH8qIPRZzx_gTo1HIZ5BuMXKzYmjWYCZUhhUl6XwmB76U2SVWtJXo8v7xrKSWi9RPZMg8xb_0tn2ckt6gU9TRZHnff/s1600/PreviousPost2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjilYfk7YnxuSo4ddxIqzXGfp92DZ3JEsue-8iXu0kh3XJiF6LQsGvH8qIPRZzx_gTo1HIZ5BuMXKzYmjWYCZUhhUl6XwmB76U2SVWtJXo8v7xrKSWi9RPZMg8xb_0tn2ckt6gU9TRZHnff/s1600/PreviousPost2.jpg" /></a></div>
<br />
<br />
<br />
<br />
We've already discussed about this method in our earlier post <a href="http://seleniumone-by-arun.blogspot.in/2013/04/32-using-gettitle-method.html" target="_blank">Post # 41 Using getTitle( ) method</a>. Go through the <a href="http://seleniumone-by-arun.blogspot.in/2013/04/32-using-gettitle-method.html" target="_blank">Post #41</a> and observe that we've used the JUnit method <b>assertTrue( )</b> JUnit method to verify whether the the Selenium RC method <b>getTitle( )</b> has retrieved the correct page Title. But now lets use the same <b>getTitle( )</b> Selenium RC method with <b>assertEquals( )</b> JUnit method to verify whether the the Selenium RC method getTitle( ) has retrieved the correct page Title.<br />
<br />
<b style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">First lets find out what a Page Title is by following the below steps:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Open </span><a href="http://www.selenium143.blogspot.com/" style="background-color: white; color: #771100; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-decoration: none;" target="_blank">http://www.Selenium143.blogspot.com</a><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. View the title of the page as shown below:</span><br />
<br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7A-n8BycbYe_kOau39qC4MISrZBObhC7NGWsc0WzXmpqx0ifC2W5nJIh6HxK-DKJ5ZUHgup2KgZMf9qRsdY5r0ziWbvHsrQjihFmMK2GrUr7-TrEfAVT1uDSE_TcNu8OxZ-DrbnUbuHMZ/s1600/1.jpg" imageanchor="1" style="color: #cc4411; margin-left: 1em; margin-right: 1em;"><img border="0" height="304" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7A-n8BycbYe_kOau39qC4MISrZBObhC7NGWsc0WzXmpqx0ifC2W5nJIh6HxK-DKJ5ZUHgup2KgZMf9qRsdY5r0ziWbvHsrQjihFmMK2GrUr7-TrEfAVT1uDSE_TcNu8OxZ-DrbnUbuHMZ/s400/1.jpg" style="border: none; position: relative;" width="400" /></a></div>
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. So in the above screenshot, 'Selenium143' text displayed on the browser tab is the page title.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;">Now lets use the Selenium RC method <b>getTitle( )</b> to retrieve the title of the page.</span></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: blue; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><b>Syntax to be used:</b></span></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><span style="color: #333333;">assertEquals("Retrieved title is not the same ","Selenium143", </span><b><span style="color: #cc0000;">selenium.getTitle( )</span></b><span style="color: #333333;">);</span></span></span><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Test Description:</b><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Now lets use </span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">getTitle( )</b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> method to retrieve the label of the page that is shown in the below screenshot:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7A-n8BycbYe_kOau39qC4MISrZBObhC7NGWsc0WzXmpqx0ifC2W5nJIh6HxK-DKJ5ZUHgup2KgZMf9qRsdY5r0ziWbvHsrQjihFmMK2GrUr7-TrEfAVT1uDSE_TcNu8OxZ-DrbnUbuHMZ/s1600/1.jpg" imageanchor="1" style="color: #cc4411; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="304" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7A-n8BycbYe_kOau39qC4MISrZBObhC7NGWsc0WzXmpqx0ifC2W5nJIh6HxK-DKJ5ZUHgup2KgZMf9qRsdY5r0ziWbvHsrQjihFmMK2GrUr7-TrEfAVT1uDSE_TcNu8OxZ-DrbnUbuHMZ/s400/1.jpg" style="border: none; position: relative;" width="400" /></a><br />
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<span style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Lets Implement the Test on Eclipse IDE:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Pre-requisites:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Create a new Project say 'RC-Project56' in Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Configure the Project to work with Selenium RC</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. Configure the Selenium Standalone Server to run from Eclipse IDE</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Create a package say 'package56' under the newly created project.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Create a Java Class file say 'Class56' under the newly created package as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkkuGO_Jtsv25lFTo9g4yYOSiJOeq5JJn8PfVbDu7-f11GZMcNHMONMu9oSKemseaFxB9yJ3e9JLvWPp5S6kjRadFIQvvbdtFpTpzToYVymiorH_ApIzzR8MMWz7dJ2uZ07YKyFNBiGZdq/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkkuGO_Jtsv25lFTo9g4yYOSiJOeq5JJn8PfVbDu7-f11GZMcNHMONMu9oSKemseaFxB9yJ3e9JLvWPp5S6kjRadFIQvvbdtFpTpzToYVymiorH_ApIzzR8MMWz7dJ2uZ07YKyFNBiGZdq/s1600/1.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;"><br /></span></b>
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Actual Steps:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">1. Write the following code into the newly created Java Class file as shown below and make sure that you resolve all the errors before going to next step:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0CgXnCwa48oDAatiJlSRxNuVCTA-PkjdIxnUe2gMRmarfNuNMWZe7OCx8iggTAVHOsb27UEeaSTzXQ8Z2-0mg25Y0erw4Zu3m29gHfG9C1GjgelndEnEDfcl_whR2TthYvlD09eXrQAi3/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0CgXnCwa48oDAatiJlSRxNuVCTA-PkjdIxnUe2gMRmarfNuNMWZe7OCx8iggTAVHOsb27UEeaSTzXQ8Z2-0mg25Y0erw4Zu3m29gHfG9C1GjgelndEnEDfcl_whR2TthYvlD09eXrQAi3/s1600/2.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">2. Create a test method 'getTitleDemo()' as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM2BTQ8LnxRp6zMr35NHmGwtmBT0E40TMVvYlOzlbOBXVtNBKE5cBNHea9L3TQ6cV_BguUpLkK-3dllGpnHy1Vvq1oJuML06JoukSe52BF7ViLO_rspJbDUnSdPzvoSGeSezYT4YDHKmN-/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM2BTQ8LnxRp6zMr35NHmGwtmBT0E40TMVvYlOzlbOBXVtNBKE5cBNHea9L3TQ6cV_BguUpLkK-3dllGpnHy1Vvq1oJuML06JoukSe52BF7ViLO_rspJbDUnSdPzvoSGeSezYT4YDHKmN-/s1600/3.jpg" /></a></div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">3. Use Selenium RC method <b>getTitle( ) </b>for retrieving the title of the website and use <b>assertEquals( )</b> JUnit method for verifying whether the title retrieved using the getTitle( ) method is equal to the specified title as shown below:</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhb0e0REy6WNoXhe2fe-dfX9PPp9vBBSvJnBpPYqm6SEHV1CTe81xlXxrC3zGhDruY5NZatO0fAHjM_hoNZO3b_R903zv5TF4GiGeZwnK6LVHCdMStdm1aEvXhOD2d94NjkjQkU7grG4SeI/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhb0e0REy6WNoXhe2fe-dfX9PPp9vBBSvJnBpPYqm6SEHV1CTe81xlXxrC3zGhDruY5NZatO0fAHjM_hoNZO3b_R903zv5TF4GiGeZwnK6LVHCdMStdm1aEvXhOD2d94NjkjQkU7grG4SeI/s1600/4.jpg" /></a></div>
<br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">4. Start the Selenium Standalone Server</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">5. Save and Run the 'Class56.java' file by selecting the 'JUnit Test' option and ensure that our Automation Test has passed to confirm that the title of the page is equal to the title that</span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> is retrieved using the getTitle( ) Selenium RC method as shown in the below video:</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Watch the below video:</span></b><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<i style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><b><a href="http://www.youtube.com/watch?v=szFubPbUxQI&feature=youtu.be" target="_blank">Click here</a></b></i><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to watch the video.</span><br />
<br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;" />
<b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: blue;">Download this Project:</span></b><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: center;">
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFQ3ubkmtpiVh9v97qwmRH6Uwyj3F52qlsd57w2zg5S3YCzP80tNIRcOEpTGGcGmDn_GxCbH-PQ_mrVAi28JEA8KeWTLXwUWio3oYD08uNbCVFFHikpnHz2aHPGqJlUq9HWRzZhOhEO0_C/s1600/next5.jpg" imageanchor="1" style="background-color: white; clear: right; color: #771100; float: right; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; margin-left: 1em; text-align: center; text-decoration: none;"><br /></a><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><i><a href="http://www.mediafire.com/?dgz528at2bciu5n" target="_blank">Click here</a></i></b><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> to download this project and import into Eclipse IDE on your machine.</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"></span><span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"> </span><b style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span style="color: #cc0000;">Please comment below to feedback or ask questions.</span></b><br />
<div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">
<b><span style="color: #cc0000;"><br /></span></b><span style="color: #38761d;"><b><i><u>Using getText command</u><span style="color: #333333;"> </span></i><span style="color: #333333;"> </span>will be explained in the next post.</b></span></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJ9bIc82II3X7icaQOId84JUVWwhG_sVAivSCT0QSrf7UiiXzYarmLekTR3YavWdSzBeM_EunwIEb2VoHNy10RY5ImQtT7z3iI6shFEtfflw1By-YhvOsUYHMDFyW0nPmSy4e_CFwnIsf/s1600/next5.jpg" /></a></div>
<br />Arun Motoorihttp://www.blogger.com/profile/18156045285817519369noreply@blogger.com0