Wednesday, March 17, 2010

Quality Center - Copying from one project to another

It always feels weird having two instances of Quality Center open in order to copy and paste tests from one project to another. But that's how QC rolls!

I had two projects with the same custom "user fields" on the "test" entity. But every time I copied and pasted tests from one project to another, the values in these fields pasted all jumbled up. That's because the fields need to have the same "Field Name" (ex: TS_USER_04). My fields had the same field label, but they needed to have the same field name. Ya know, that magical name automatically assigned by QC.


Saturday, March 13, 2010

Locating Pop-Up Windows in Selenium IDE

Here's a good article about handling pop-up windows. This is for pop-up browser windows, not modal windows.

Basically, you have to '''selectWindow''' to select the popup window and execute commands on that window. To return to the main window, use the command '''selectWindow(null)'''. This command only works if the browser only has one tab open (which will be the main window's tab). If multiple tabs are open in the browser, Selenium will error.

Javascript for creating random numbers in Selenese

I use these javascript snippets in Selenese to generate random numbers in a Selenium IDE script. This is helpful when a value has to be unique.

Here's an example using javascript to get the current timestamp and use that value for the variable ("codigo" in this example):

storeEval
new Date()
today

storeEval
storedVars['today'].getTime()
codigo

type
bsa.olbServiceId
${codigo}

echo
Codigo is ${codigo} for WOV Everything

Below, I needed to generate random usernames that were 6-20 characters with letters and numbers. I used Javascript to get the current timestamp, converted it to a string, then contatenated with 'usr':

storeEval
new Date()
today

storeEval
storedVars['today'].getTime()
numtime

storeEval
storedVars['numtime'].toString()
time

storeEval
['usr']+storedVars['time']
username

echo
${username} is the username.

More info on Javascript and Selenese is in the Selenium documentation.

Helpful Firefox Add-On's when using Selenium IDE

The following Firefox Add-on's will help you use Selenium, particularly when it comes to XPath Locators:

* XPath Checker - suggests XPath and can be used to test the XPath you write.
* Firebug - XPath suggestions are just one of the many powerful features of this very useful add-on. You can inspect elements to view the HTML code for that element.

Quality Center Microsoft Word Add-In Tips

I'm using the QC Microsoft Word Add-In for the first time and learning all of it's quirks. I'm importing Requirements into QC. Or as QC likes to say, "exporting".

It seems to want me to rename the Requirement Types in my project before it will recognize the Type during "export".

For example, upon export, I kept getting the error:
"Requirement Type 'Business' does not exist in the requirement type lookup list."

I had the requirement type "Business", which I think is a default type. In Project Customizations, I had to rename "Business" to "Business Requirement". Then Import the requirement types using the Word QC Macro. Then I could successfully export the requirements without getting that error.

Then later I was getting the same error with other requirement types. I found that if I imported the requirement types from my project right before exporting to QC, the errors went away.

Very strange. I'm on Windows 7 with Office 2007 and an outdated QC version; so maybe that's why.