Home

Search

Guestbook

Contact Us

Log in

Join Us

Testers Community

Link to Us

Advertise with Us

 

  Testers Community

What is Software
Testing?

Why are There Bugs?

Bug Stories

Testing Newsletter

Advanced Job Search
powered by dice.com

To ship the Product

When Project is Done

Glossary of Computer
Terms

Tester to Tester

Play Computer Game

Link to Us

Advertise with Us
   


  Interested in opening an online store? If so, we think you'll like our Affiliates Program. The concept is simple. Read More

 


  When Should a Test be Automated?

Success with Test Automation


How Mature is Your Automated Test Suite


How to Automate Testing of Graphical User Interfaces

STQE Magazine

Totally Data-Driven Automated
   


  Tell a friend about
the page you just visited!

Enter the recipient's
email address, click "Send" and it's on the way. (link to the page along with a brief description will be sent)

 

   
 
 
 

You are here: Home > Tips and Hints > Automation TestingTips | 1 |

 
   

 

Send us your QA Partner Tips,
so that we can publish them here...

QA Partner tips:


How do I get out of an infinite loop? Click here

CurrentPath and CurrentFile keywords Click here

Printf Click here

Are the SilkTest Products Y2K Compliant? Click here

Let Silk do the Hard Stuff Click here

A Semi-Automated Way to do Manual Testing Click here

GetExecutableVersion Click here

Binding Agent Options Click here

Fault Trapping Click here

DontInheritClassTag Click here



Help! How do I get out of an infinite loop?
If you have code that continues in a while loop until a dialog appears -- and that dialog fails to be invoked -- then you may end up in an infinite loop.
Normally, you can simply choose Abort from the Run menu. Sometimes, though, the automation keeps trying to make the test application active making it nearly impossible to access the SilkTest menus.
In this case, there is a 'back-door' way of aborting the running of the automation script ... Press BOTH Shift keys simultaneously
 

top

 
CurrentPath and CurrentFile keywords
CurrentPath is a keyword whose value is the path (not including the file name) of the file containing the reference to CurrentPath. CurrentFile is a keyword whose value is the name of the file (not including the path) containing the reference to CurrentFile.You can use these keywords to locate files at runtime.
See the Silk Online help for more information
 

top

 
Printf
Besides the well-known Print function, 4Test also supports the Printf function, same as for Ansi C.
See the Silk Online help for more information
 

top

 
The Segue product line is Y2K compliant.
But don't take my word for it -- take a look at their web page
Click here
 

top

 
Let Silk do the Hard Stuff
For instance, if you want to explicitly trap for an exception of type
"Window Not Found", then what is the Exception Number to look for? Yes, you can find the Segue source files and read through the approximately 170 exception numbers until you locate the one you want. An easier way is to write code such as this:

do
//reference to a declared window
//that will not be found (such as a
//modal dialog that is not invoked)
except
Print (ExceptNum ())

By doing this, the result file will contain the string "-27800". That's
exactly what we are searching for.
Now I can write the code in this way:

do
//reference to a declared window
//that maybe will not be found
//(such as a modal dialog that is
//not invoked)
except
if (ExceptNum () == -27800)
LogWarning ("your message...")
else
reraise

Note that reraise passes control to the next exception handler in the current block, or in any block in which the function that caused the exception is called. If no other exception handler is found, the script halts.
 

top

 
A Semi-Automated Way to do Manual Testing
No automation tool can easily test such elements as Bitmaps, Colors, or
Fonts as the Device Context handle has already been recycled by the time
that object has been painted.
However, a clever approach to this testing can be done by combining Active Links with automation. In general, the "automation" would work this way: The Form Window or Dialog is opened, with some bitmap, color, or
font on it -- and the text trim asks the user if that element looks correct
(such as, "If the button's text does not look red, then press the 'Fail'
button.") When the user pushes the appropriate button, then the Active Link
fires and then either closes the Dialog and/or perhaps changes a status from 'New' to either 'Pass' or 'Fail'. The automation, which has been waiting either for the Dialog to no longer exist or for the status to no longer be 'New', now can get out of the "infinite" while loop and go to the next line in the script. If the test fails, based upon the user's input, the automation then
logs the appropriate failure to the results file. This still requires the automation to be monitored and some questions answered by a human, but the tedious, repetitive actions are automated.
 

top

 
GetExecutableVersion
This is a new method made available in Silk 5.0.2 ... it is not supported,
but seems to work. I don't know all of its uses, yet, but it is useful when
trying to determine the version of Browser.
For instance, the following code will return the major version and minor
version of the Internet Explorer Browser (where it has been set as the
default browser) as 5 and 0:
INTEGER iMajor, iMinor
Browser.GetExecutableVersion (iMajor, iMinor)
 

top

 
Binding Agent Options
Normally, if you need to change an Agent option within your script, you end
up writing code such as:
Agent.SetOption (OPT_VERIFY_UNIQUE, FALSE)
// Your code that requires non-unique windows
Agent.SetOption (OPT_VERIFY_UNIQUE, TRUE)
which turns out not to work well because sometimes your testcase fails in
the code between the setting of Agent options and it never gets reset (such
as back to TRUE in the example above).
A solution to this is to instead use BindAgentOption in a withoptions block.
For example, the same code above would look like this:
withoptions
BindAgentOption (OPT_VERIFY_UNIQUE, FALSE)
The nice thing is that the 4Test code remembers the previous Agent option
and resets it when the block exits. Although listed in the Help file as
officially being "... provided as a convenience to you, but ... not
thoroughly tested, " it works well and doesn't seem to cause any
side-effects in existing automation code.
 

top

 
Fault Trapping
If you plan to use 32-bit Fault Trapping in your automation, remember to not
set it up on your Windows 95 workstations.
As it states in the SilkTest release notes -- On Windows 95, if you have
fault trapping enabled and a fault occurs, SilkTest may freeze. (Issue
#25713).
 

top

 
DontInheritClassTag
If you derive a new class based upon an existing one, then the Window
Declarations Recorder has an irritating habit of using the new class name
when recording -- rather than the class itself. For instance, if you created a class RButton that is of type PushButton, the recorder will record all future push buttons as being RButton class. There are two ways to avoid this. The less intuitive way is to provide a placeholder tag (such as "Dont Use This") when defining your new class. Any instance of this class will have its own tag that will override the "bogus" one. At least this way, the recorder now won't mistakenly misdeclare the object. The better way to do this, though, is to add the line of code "setting DontInheritClassTag=TRUE" under the new window class declaration. When using that line of code, you don't need to create bogus tags.
         
    Talk about this in SQAtester Group  
         

 

top

 

 

cover

Testing Applications on the Web
Written by a true authority in the field, Hung Q. Nguyen's Testing Applications on the Web is a nicely comprehensive guide to virtually every conceivable aspect of software testing... Read More

Testing Object-Oriented Systems
Testing Object-Oriented Systems is a guide to designing test suites and test auto- mation for object-oriented software... Read More

 

cover

 

 

top

 
 

   

bugs and fixes   software life cycle  
bugs life   SQA career  
bug tracking   testers area  
companies and products   tester to tester  
documentation and strategy   testing center  
methodology and techniques   testing newsletter  
more resources   testing tips  
publication and news   tools and automation  
QA team   tutorials and training  

   

Join Now Free   Message Forum  
Share Your Experience   Professional Profiles  

   

Bargains   Sweepstakes  
Books   Magazines  

     

Get your company Product Storefront   Software  
Software Testing Books   Free Downloads  
Bug Alerts      
       

     

MakeMake SQAtester.com Your Home Page Your Home Page.

 

 

AddAdd SQAtester.com to Your Favorites to Your Favorites

       

 

  Whether you are at the office, home, or your client's site, your information should be available at your fingertips. We can make this possible. Read More

 

© Copyright since 2000 by SQAtester.com. All Rights Reserved. For information on SQAtester.com, visit About Us