Friday, April 29, 2011

Quality Assurance vs. Testing

I've known QA Analysts who became very upset when called "testers". There's an idea that being an "Analyst" means you analyze the quality of an application, which involves more than just testing. Being called a "tester" implies that all you do is test and nothing else.

There are a lot of strong opinions about whether we are in the Quality Assurance or Testing business.

I really like Michael Bolton's blog post on the subject:
http://www.developsense.com/blog/2010/05/testers-get-out-of-the-quality-assurance-business/

(insert over-used, but still funny Office Space joke here)

Wednesday, March 23, 2011

Selenium IDE and Wicket

When testing a Wicket application, Selenium IDE often records element id's that are dynamic and change every time the application is opened. To resolve this problem, I followed this tip from https://issues.apache.org/jira/browse/WICKET-1830 by Frank van Lankvelt.

Create a folder "wicketPathLocatorBuilder" with the file "user-extension.js.wicketPathLocatorBuilder". Paste the following snippet in this file.
 
LocatorBuilders.add('wicketpath', function(e) {
this.log.debug("wicketpath: e=" + e);
if (e.attributes && e.hasAttribute("wicketpath")) {
this.log.info("found attribute " + e.getAttribute("wicketpath"));
return "//" + this.xpathHtmlElement(e.nodeName.toLowerCase()) +
"[@wicketpath=" + this.attributeValue(e.getAttribute("wicketpath")) + "]";
}
return null;
});

LocatorBuilders.order.unshift(LocatorBuilders.order.pop());

Open Selenium IDE, go to menu Options -> Options. In the Selenium Core extensions input field, paste the path to the earlier created folder "wicketPathLocatorBuilder". Restart firefox.

Now when you record tests, the wicketpath attribute is used to generate an element locator.

Wednesday, February 23, 2011

Incremental Variables in Selenium

I needed to create 50 names that were similiar and incremental (ex: Tracey1, Tracey2, Tracey3, etc.). I used javascript to increment the numbers.

<!--Here I store the alpha-text part of my name as variable 'a'. This allows me to change this later to something else.-->

<tr>

<td>store</td>

<td>Tracey</td>

<td>a</td>

</tr>

<!--This increments the number ('y'), starting at 1-->

<tr>

<td>store</td>

<td>1</td>

<td>x</td>

</tr>

<tr>

<td>storeEval</td>

<td>storedVars['x'] = ${x}+1</td>

<td>y</td>

</tr>

<!--Here I type the name-->

<tr>

<td>type</td>

<td>fieldname</td>

<td>${a}${y}</td>

</tr>

<!--And the next time I need to type the name, I just increment 'y' by one-->

<tr>

<td>storeEval</td>

<td>storedVars['y'] = ${y}+1</td>

<td>y</td>

</tr>

<tr>

<td>type</td>

<td>fieldname</td>

<td>${a}${y}</td>