Future maintenance and readability should take precedence over the minor inconvenience of replacing a small number of values by hand. Some of these constants are inserted for you automatically while recording or using the function generator, but you must insert many of them manually.
![define winrunner define winrunner](https://images.slideplayer.com/26/8618257/slides/slide_13.jpg)
#Define winrunner code#
What does the following line of code do?ĭo you give up? Obviously WinRunner will continuously loop until the return value of the get_mouse_cursor function is no longer equal to 65557, but what does this magic number 65557 really mean? Whoever has to read your test scripts when you’re gone won’t have to spend time pondering this sort of question if you use a descriptive constant name instead of a unintelligible value.Ī good rule to follow is that no-one who has to read your scripts should have to know what a number means, unless it is obvious from the way it is used (like a time delay, or an index). No one reads the comments in the WinRunner Test Results unless something fails. If a test script fails when it should not, someone will investigate and find the mistake in the script but if it passes when it should not, the first you will hear of it is when a user discovers a defect in Production. The tl_step function interprets a 0 value as a pass, and any other number as a fail.Īccidentally using a pass value instead of a fail value is quite a nasty bug.
#Define winrunner manual#
If you answered “pass”, you probably need to spend less time reading the WinRunner manual and more time actually testing.
![define winrunner define winrunner](https://www.abbreviationfinder.org/images/entry_pdf/wr/wi/wr_winrunner.png)
If you answered “fail”, you probably figured it out from reading the other arguments to the function – and you would be wrong. Tl_step(“Check that transaction completed successfully.”, 0, “Transaction did not complete successfully.”) What does the numeric argument to the tl_step function below set the test step status to? Is anyone interested in reading a document like this? No magic numbers I’m thinking of writing a WinRunner Coding Standards document (as if there weren’t enough of them out there already), but with more of a focus on why things should be done a certain way rather than just dictating how code should be written. Proven ability to define, develop and maintain automated test cases with automated testing tools, like Selenium, ReadyAPI, WinRunner, QuerySurge, BrowserStack, etc.