Frequently Asked Questions
[updated: 16 June 2005]
Questions from customers, with responses.
-
What language should I use to record my tests?
-
Does TestSmith work with VB/.Net/Python/Java/etc. applications?
-
The setVar command does not seem to work.
-
How can I get the difference between two timestamps?
-
Can I prevent TestSmith freezing when a javascript popup appears?
-
How can I prevent msLClick being recorded when a htmlLink
(or other html command) is required?
-
What should I do when I see the 'mouse click failed to record' message
in my script?
-
How do I record actions on the Windows "Start" menu?
- What language should I use to record my tests?
Answer:
This is mostly a matter of preference. As a general guide, you should
use the proprietary Smith language if you want to play back your tests
immediately, or if you don't require much in the way of program logic.
Smith is a simple script language and useful for test-protoyping.
For more robust tests you should use either Java or C++. These tests
will need to be compiled with an appropriate compiler for the language.
It is a fairly trivial task to adapt a test from Smith into either Java
or C++. The command names in Smith become method names in Java and C++;
each method's first parameter is a single string consisting of all the
TestSmith command parameters.
See the following guides for more information on specific languages:
Java,
C++,
C++/MFC
- Does TestSmith work with VB/.Net/Python/Java/etc. applications?
Answer:
TestSmith is a GUI-level test automation tool. It does not care what language
an application was written in, so long as it can run on the Windows platform.
TestSmith does not integrate with any development environment; that is not
it's intended purpose. It tests applications through GUI interaction,
effectively behaving as a virtual user.
To uniquely identify specific objects TestSmith uses the internal Windows
object hierarchy for desktop applications and the HTML Document Object Model
(DOM) for any HTML-based application.
Applications, such as Java Swing applications, that do not use native Windows
objects, but actually 'paint' the GUI on the screen are harder to record,
especially if the GUI changes during development, and buttons and other
items are moved to new locations. TestSmith offers a
Seek Item functionality for such applications.
This functionality allows any screen item to be searched for by bitmap pattern.
- The setVar command does not seem to work.
Answer:
Ensure the syntax is correct, e.g. use
=: to set a new value to the variable,
=+ to add a value to the current value of the variable,
=- to subtract a value from the current value of the variable.
See Set Variables for more information
- How can I get the difference between two timestamps?
Answer:
Use code similar to the following:
-------------------------------------------------------
SET DECLARE=[time1][time2][timeDiff] ;
# commands ...
reportTime time1=: remark2='point1: {time1}' ;
# more commands ...
reportTime time2=: remark2='point2: {time2}' ;
setVar timeDiff=:{time2} ;
setVar timeDiff=-{time1} remark2='difference: {timeDiff}' ;
-------------------------------------------------------
The reset parameter can also be used to
reset the timer after each reportTime
command, thus getting the time for a sub-set of commands.
- Can I prevent TestSmith freezing when a javascript popup appears?
Answer:
Yes. The playback freeze is caused by any modal popup that appears during
a web application playback, including 'Open File' dialogs and javascript alerts,
among other types.
It is the result of the way the activating button or link is clicked, i.e.
internally via the DOM object for the web page.
To avoid this problem add the
hevent parameter (hevent=1)
to the command that causes the popup to appear - usually a
htmlInput or
htmlLink command. The hevent parameter
will trigger the popup and allow the script to continue executing.
Note: a script containing the hevent parameter
cannot be played back to a minimized browser.
- How can I prevent msLClick being recorded when a htmlLink
(or other html command) is required?
Answer:
First of all, clear the cache. If the page being navigated to is cached it will
load much faster; it is the fast loading of the new page which may be causing the
htmlLink or other
html command to be missed.
If this does not work there are other methods to create the desired html command
you want. Both require some manual editing of the script;
#1 is the easier of the two.
1. Hold down the CTRL key and right click on the link. A small text
window will popup with details of the link. Click on the 'Validate
Element' button in this window, this will record a
valHtmlElem command
to the script. Edit this command as follows:
- change the name to htmlLink
- copy the href url from the hhtml parameter
- remove the hhtml parameter
- create a hhref parameter with the copied text.
2. Generate a HTML/DOM map of the page.
Open the map in a text editor. Copy the details of the element you are
interested in. Manually create a htmlLink with the appropriate parameters
(you will need the id=
and wnum=
(and possibly hframe=) parameters from the
top section of the map also.
Both these options require that TestSmith be in recording mode. Once
you have created the command you can click on the link and then remove
the offending msLClick command from the script.
Additonal information is here.
- What should I do when I see the 'mouse click failed to record' message
in my script?
Answer:
When web mode is switched on the message:
# Mouse click failed to record. Return to the previous state and try again.
# If the problem persists, restart the recording using the 'Continue' button.
may be seen. This occurs for the same reason that a
msLClick is sometimes recorded in normal mode.
Details of the workaround for both these issues is described in
question 6.
- How do I record actions on the Windows "Start" menu?
Answer:
This is not possible. Instead you should manually add a
kbMenuSelect command to your script.
The command must contain the wtitle=Desktop_Taskbar parameter.
Example - select the Settings/Print item on a Windows 2000 system to open the
Print dialog box.
wndInit
id=1
wtitle=Desktop_Taskbar
wclass=Shell_TrayWnd ;
kbMenuSelect
id=1
wtitle=Desktop_Taskbar # must have this parameter
menuitem=S>}} # select the Setings item (S), then
# hit right arrow, then down arrow twice
mtime=100 ;
The following parameters will also work instead of the menuitem=S>}} parameter.
menuitem={{{{{>}}
menugo=UUUUURDD
See the menuitem and
menugo sections of the User Guide for more information.
|