<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Chen&#039;s own thoughts, tips and suggessions on software Testing</title>
	<atom:link href="http://chenththuran.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://chenththuran.wordpress.com</link>
	<description></description>
	<lastBuildDate>Sat, 31 Jul 2010 09:33:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='chenththuran.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/45f1a21f484f629302002897167125c5?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Chen&#039;s own thoughts, tips and suggessions on software Testing</title>
		<link>http://chenththuran.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://chenththuran.wordpress.com/osd.xml" title="Chen&#039;s own thoughts, tips and suggessions on software Testing" />
	<atom:link rel='hub' href='http://chenththuran.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Selenium testing with Java/Eclipse</title>
		<link>http://chenththuran.wordpress.com/2010/07/24/selenium-testing-with-javaeclipse/</link>
		<comments>http://chenththuran.wordpress.com/2010/07/24/selenium-testing-with-javaeclipse/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 19:17:55 +0000</pubDate>
		<dc:creator>chenththuran</dc:creator>
				<category><![CDATA[Automation]]></category>

		<guid isPermaLink="false">http://chenththuran.wordpress.com/?p=33</guid>
		<description><![CDATA[Here I explain how to convert a recorded test case to a particular language of choice and execute that through an IDE. I consider my language of choice as Java and my IDE as Eclipse. I have created a selenium script to test the log in/log out functionality of the website warehouse.co.uk. I am going [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chenththuran.wordpress.com&amp;blog=5139707&amp;post=33&amp;subd=chenththuran&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here I explain how to convert a recorded test case to a particular language of choice and execute that through an IDE. I consider my language of choice as Java and my IDE as Eclipse. I have created a selenium script to test the log in/log out functionality of the website warehouse.co.uk. I am going to execute this as a java application.</p>
<p>Step-1</p>
<p>Record your test case using the selenium IDE. I assume we all know how to record a test scenario using selenium IDE. Once recorded, export the test case as Java(JUnit)-Selenium RC and save it as a java file. You can do this by naming the file with a .java extension. I have saved my exported script as WarehouseLogin.java</p>
<p><a href="http://chenththuran.files.wordpress.com/2010/07/img-1.jpg"><img class="aligncenter size-medium wp-image-34" title="Export to Java" src="http://chenththuran.files.wordpress.com/2010/07/img-1.jpg?w=295&#038;h=300" alt="" width="295" height="300" /></a></p>
<p>Step-2</p>
<p>Open Eclipse and create a new java project and then add selenium client driver to the project. You can do this by right click on the project,</p>
<p>Properties&gt;java build path&gt;libraries&gt;Add external jars</p>
<p>Search and find the selenium-java-client-driver.jar (which is at C:\selenium-remote-control-1.0.3\selenium-java-client-driver-1.0.1) and add the jar file.</p>
<p>Similarly add the junit libraries as well. To do this, Right click on the project, Properties&gt;java build path&gt;libraries&gt;Add Library. Select junit and add it.</p>
<p>Step-3</p>
<p>create a package under the project. To do this right click on the project, new&gt;package. Type the package name as com.examples.tests.</p>
<p>Now create a new class under this package with the name WarehouseLogin. To do this, right click on the package New&gt;class; give the class name as WarehouseLogin and finish. Overwrite your newly created java class with the recorded selenium script.</p>
<p>Step-4</p>
<p>I modified the java class as given below to run it as java application. I will discuss how to run as a Junit test in my future post.</p>
<p>package com.example.tests;</p>
<p>//import the necessary packages and classes<br />
import com.thoughtworks.selenium.*;<br />
import java.util.regex.Pattern;<br />
import com.example.tests.Server;</p>
<p>public class WarehouseLogin {</p>
<p>private Selenium selenium;<br />
private final static String URL = &#8220;http://www.warehouse.co.uk&#8221;;</p>
<p>public void setup()throws Exception{<br />
//I am using my startSeleniumServer()method which I wrote in Server class to start the selenium server. if you manually start the server, then you can comment the line<br />
Server.startSeleniumServer();<br />
selenium=new DefaultSelenium(&#8220;localhost&#8221;,4444,&#8221;*firefox&#8221;,URL);<br />
selenium.start();<br />
selenium.open(URL);<br />
}</p>
<p>/**</p>
<p>*This method test whether a login is successfully with valid data</p>
<p>*/</p>
<p>public void testLogin() throws Exception{<br />
selenium.open(&#8220;/&#8221;);<br />
selenium.click(&#8220;headerMyAccount&#8221;);<br />
selenium.waitForPageToLoad(&#8220;30000&#8243;);<br />
selenium.type(&#8220;loginEmail&#8221;, &#8220;nadarajah.chenththuran@bt.com&#8221;);<br />
selenium.type(&#8220;loginPassword&#8221;, &#8220;09101978&#8243;);<br />
selenium.click(&#8220;//form[@id='loginForm']/fieldset/div[3]/input&#8221;);<br />
selenium.waitForPageToLoad(&#8220;30000&#8243;);<br />
System.out.println(&#8220;Login successfuly&#8221;);</p>
<p>}</p>
<p>/**</p>
<p>*This method test whether a logout is successful</p>
<p>*/<br />
public void testLogout()throws Exception{<br />
selenium.click(&#8220;//img[@alt='Log Out']&#8220;);<br />
selenium.waitForPageToLoad(&#8220;30000&#8243;);<br />
System.out.println(&#8220;Logout successful&#8221;);<br />
}</p>
<p>public void stopServer(){<br />
// I am using my stopSeleniumServer()method which I wrote in Server class to stop the server.<br />
Server.stopSeleniumServer(selenium);<br />
}</p>
<p>public static void main(String[] args){<br />
try{<br />
WarehouseLogin whl=new WarehouseLogin();</p>
<p>//new object is created and methods are called.<br />
whl.setup();<br />
whl.testLogin();<br />
whl.testLogout();<br />
whl.stopServer();<br />
}catch(Exception e){<br />
System.err.println(e);<br />
}<br />
}<br />
}</p>
<p>I believe this will help those who wish to know how to export and use selenium with their language of choice.</p>
<p>We can use JUnit with Selenium which I will discuss in my future posts.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chenththuran.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chenththuran.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chenththuran.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chenththuran.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/chenththuran.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chenththuran.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/chenththuran.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chenththuran.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chenththuran.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chenththuran.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chenththuran.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chenththuran.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chenththuran.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chenththuran.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chenththuran.wordpress.com&amp;blog=5139707&amp;post=33&amp;subd=chenththuran&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://chenththuran.wordpress.com/2010/07/24/selenium-testing-with-javaeclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6ca5ad1e7badabd1ad5901f663770f52?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chenththuran</media:title>
		</media:content>

		<media:content url="http://chenththuran.files.wordpress.com/2010/07/img-1.jpg?w=295" medium="image">
			<media:title type="html">Export to Java</media:title>
		</media:content>
	</item>
		<item>
		<title>Why this bug was not captured before?</title>
		<link>http://chenththuran.wordpress.com/2010/07/23/why-this-bug-was-not-captured-before/</link>
		<comments>http://chenththuran.wordpress.com/2010/07/23/why-this-bug-was-not-captured-before/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 23:00:42 +0000</pubDate>
		<dc:creator>chenththuran</dc:creator>
				<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://chenththuran.wordpress.com/?p=26</guid>
		<description><![CDATA[Muhammad Usman has already raised this question in linked in. “What will be the appropriate answer of the question from management why this bug was not captured before?” As I am also quite familiar with this question, I thought to write what I think can be the reasons. When I was working in Pandora Inc, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chenththuran.wordpress.com&amp;blog=5139707&amp;post=26&amp;subd=chenththuran&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://chenththuran.files.wordpress.com/2010/07/scratchinghead.jpg"><img class="alignleft size-full wp-image-27" title="ScratchingHead" src="http://chenththuran.files.wordpress.com/2010/07/scratchinghead.jpg?w=600" alt=""   /></a></p>
<p>
Muhammad Usman has already raised this question in linked in. “What will be the appropriate answer of the question from management why this bug was not captured before?” As I am also quite familiar with this question, I thought to write what I think can be the reasons.</P></p>
<p>
When I was working in Pandora Inc, I was asked  a similar question by Linda, my project manager for a particular functionality, I was so sure that I tested that functionality during the system testing and then in regression testing as well. The defect was found after a data migration from live database which was after the UAT. As we do not run the regression test cases after the UAT, we did not test this functionality after the data migration. PM asked “why was this not captured before”. I told that it was not captured before because it was not an issue before the data migration. Then she asked “are you sure you tested this before and do you have the template” Unfortunately I missed that test result template for that functionality. Even though I explained to the PM that there was no defect during the regression testing and the UAT, she was understandably upset.</p>
<p>
Linda threw the same query again in another project where I did not even know that there was such a requirement. The defect was identified by the client. Once Linda saw the defect report, she came straight towards me and asked the same so called question “Why was this not captured before”. I told her that it was not captured before because I did not know it was an issue because I did not know it did not meet the requirement because I did not know such a requirement because it was documented nowhere.</P></p>
<p>
There was another situation where I captured an issue while doing a system testing. That issue was fixed and retested and then closed by me. The issue did not happen during the regression testing cycle. But regressed during the UAT. Samuel  did not know this issue was already logged and retested. She asked “why was this not found before”. I proved her that it was tested before by showing the issue number. When I did a root cause analysis, I found that the developers did some code change in between the regression test cycle and the UAT which caused the issue.</P></p>
<p>
I agree that we testers miss some defects due to many reasons such as pressures due to crazy dead lines, poor requirements, lack of domain knowledge and so forth. At the same time PMs should understand that there are high chances for an issue to be regressed at any stage due to last minute code fixes, configurations, migrations and so forth.  They have to find out the root cause without simply blaming the testers.</p>
<p>
First of all PMs should appreciate the testers as the defect was found before live. Only testers can not be responsible when a defect is found at last minute. It’s a team problem and we as a team should diagnose and resolve it. As Shrini commented “What would a police say if he is asked why a certain robbery was not prevented?” Police can only help to reduce the level of robbery, but can’t stop all. We testers also are same as Police officers.</p>
<p>﻿</p>
<p>Note: I have taken the opportunity to use one of  my My dream company name and project manager to discuss the subject line.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chenththuran.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chenththuran.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chenththuran.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chenththuran.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/chenththuran.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chenththuran.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/chenththuran.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chenththuran.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chenththuran.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chenththuran.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chenththuran.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chenththuran.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chenththuran.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chenththuran.wordpress.com/26/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chenththuran.wordpress.com&amp;blog=5139707&amp;post=26&amp;subd=chenththuran&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://chenththuran.wordpress.com/2010/07/23/why-this-bug-was-not-captured-before/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6ca5ad1e7badabd1ad5901f663770f52?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chenththuran</media:title>
		</media:content>

		<media:content url="http://chenththuran.files.wordpress.com/2010/07/scratchinghead.jpg" medium="image">
			<media:title type="html">ScratchingHead</media:title>
		</media:content>
	</item>
	</channel>
</rss>
