Thursday, 14 May 2009

Test framework - Multiple tool support

To design a robust and cost effective automation framework is a complex task...

This morning a read a good post about Programming Paradigms in Test Automation which I can recommend reading.

I have on my agenda to switch from VBScript to Java in my framework. I have realized that this process is going to take a while since I have not yet found a decent tool for the GUI testing part...

I am currently evaluating Watij and so far it seems really promising since it can deal with pop-ups much better than Selenium. However, test execution speed is not that good when running Watij (QTP or worse) from IDEA so next step is to see how it handles stand-alone execution...stay tuned

Since I want to support multiple tools/langauges in my framework I have decided to move all SQL from code to Store procedures for easier maintenance. Here is an overview picture of how it will look like when implemented:

Tuesday, 5 May 2009

VBScript: Sending e-mail

Sending e-mail automaticly at various test contexts could be a useful feature (beware of "spam" if you are sending mail to a shared address...) so as a follow-up to this post: http://abouttesting.blogspot.com/2008/01/cdomessage.html I thought I would share an example on how to send an HTML-based e-mail using CDO:



'Sending E-mail sample

strEmailSubject = "Testing CDO"
strMessageFrom = "myemailfrom@mydomain.com"
strMessageTo = "myemailto@mydomain.com"
strHTMLBody = "<B>Bold</B>&nbsp;example"
strSMTPServer = "mail.mydomain.com"

SendEmail strEmailSubject, strMessageFrom, strMessageTo, strHTMLBody, strSMTPServer

Function SendEmail (strEmailSubject, strMessageFrom, strMessageTo, strHTMLBody, strSMTPServer)
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = strEmailSubject
objMessage.From = strMessageFrom
objMessage.To = strMessageTo
'The line below shows how to send using HTML included directly in your script
objMessage.HTMLBody = strHTMLBody
Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).
Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM
'==This section provides the configuration information for the remote SMTP server.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTPServer
'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoAnonymous
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
'Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objMessage.Configuration.Fields.Update
'==End remote SMTP server configuration section==
objMessage.Send
End Function






You can download the script here:
http://abouttesting.fileave.com/SendEmail.zip

Monday, 4 May 2009

Test framework - Multi-threading

From http://abouttesting.blogspot.com/2008/06/test-framework-brief-description.html

Known limits:
Parallel execution is not implemented (you cannot use multiple test tool instances for a test run in order to decrease test execution time).


Check. Implemented today :-)

Solution: Call a Store procedure with test run id and test run option id (including test tool type) and it returns next compatible test case in the execution queue including Go/NoGo (if NoGo wait until Go critera is met).

Is this a necessary feature?

I have many test suites that are End-to-end based and spans over several test days. Since each day requires a lot of batch processing (included in test suite as well) you want to combine a lot of test scenarios in one test suite instead of having one test suite/test scenario. The largest test suite has now over 900 test cases (multi steps)...so anything that reduces overall execution time is very welcome :-)