Win Runner Faq

Frequent Questions about WinRunner.


Why does the minus sign not appear when using obj_type(), win_type(), type()?

If using any of the type() functions, minus signs actually means hold down the button for the previous character. The solution is to put a backslash character "\\" before the minus sign. This also applies to + < >. You can disable this by setting the variable "key_editing" to off. setvar("key_editing",off); You may also set this option using the Settings > General Options > Record > Advanced uncheck "Generate concise, more readable type statements"


Can I use more than one sheet in Excel with the DDT functions?

Officially only a single sheet is supported. In practice, the "active" sheet will be used, so to select a different sheet you can make it active (and move it to the first sheet just in case). There is a vbs script to do just this in the Yahoo Groups, Files section, look for "excel_sheet_vbs.txt".


There seems to be a problem working with DOS windows.

From version 7, working with the console was turned off by default. To turn it back on:

 setvar("skip_nt_console", 0);
Or set the following in wrun.ini

 [WrCfg]
 HL_SKIP_NT_CONSOLE=FALSE
There is another workaround floating around where the window handle is retrieved and used, but it has problems with functions like win_get_text.


Regular expression wildcard incorrect?

The WinRunner User Guide says that Asterisk (*) matches one or more characters, but actually it matches zero or more.

AB*C would match: AC, ABC, ABBBC


What are class and MSW_class for in the physical description?

WinRunner interprets Window objects roughly as follows:

MSW_class is taken from the windows classname, eg. the top window of notepad has MSW_class of "Notepad", a standard button has MSW_class "Button".

If the object is a top window, WinRunner will set class: window, and by default use MSW_class and label to identify the window.

If WinRunner "knows" the MSW_class (see GUI configuration), it will set class to the object type, eg. for MSW_class "Button" WinRunner will set class: push_button, then it can drop the MSW_class property from the minimum needed to identify the object. This is why many objects in the GUI map do not have MSW_class.


How do I find the active window?

Use a physical description of "{class: window, active: 1}", in a function, eg.

 win_get_info( "{class: window, active: 1}", property, value)


After a file_compare, I want view the differences, but I don't like WinDiff.

When in the results viewer, if you double-click a failed file comparison, WinRunner opens WinDiff with the expected and actual files. This is done with a messy workaround of setting the two files in WinDiff's ini file.

There are some nice file comparing tools around, eg. Beyond Compare 2. To replace WinRunner's use of WinDiff with any alternative, the following program is available:

http://groups.yahoo.com/group/winrunner/files/wdiff_replace.zip (about 12KB)

Included is the exe, sample config for Beyond Compare 2, and the source code in C.


How do I use strings longer than 1024 characters?

Increase WinRunner's string limits by increasing the MAX_STR_LEN as defined in wr_gen in the lib directory. Restart WinRunner for the change to be recognised.

will you please tell me what is the exact use of batch testing in winrunner and how we may implement batch testing in winrunner.


Close WinRunner from within a script?

This can be useful to shut down WinRunner at the end of a test run.

 load_dll("user32.dll");
 extern int PostMessageA(in long, in long, in long, in long);
 win_get_info("{class:window, MSW_class:AfxMDIFrame42, label:\"!WinRunner.*\"}", "handle", hWnd);
 PostMessageA(hWnd, 16, 0, 0);


Is there a Free framework in TSL for Winrunner with integration in Testdirector?

There are some Free framework available. One is from EMOS and can get in the Yahoo group for EMOS_frame:

http://groups.yahoo.com/group/EMOS_framework/

Welcome Thank you for showing interest in EMOS FRM, the simple test framework for WinRunner®. Explore this document to find out how to develop WinRunner scripts that allow non-technical people (people with practically no WinRunner knowledge) to write most of the functional tests you will ever need.

About this document In this document you can find background information about the test automation approach - the foundations of EMOS FRM. Further you will find detailed descriptions of various parts of the framework and tips for its effective usage.

Other documents EMOS FRM is accompanied with the API documentation. This is a Java-like set of HTML files that describe the functions contained in the EMOS_GPL library.

http://www.cbueche.de/welcome_to_emos_group.htm

About the authors The EMOS FRM was developed by an enthusiastic team of software developers/testers of EMOS Computer Consulting GmbH. Please do let us know what you think about this product. In particular let us know about our mistakes.

Thanks

mailto:cbueche@cbueche.de

Homepage: http:\\www.winrunner.de



EditText of this page (last edited May 16, 2005) or FindPage with title or text search