Prepare for your Next Interview
This is a discussion on input to TSL script in WINRUNNER within the WinRunner forums, part of the Software Testing category; Hi, I want to know whether we coukd give a run time input to winrunner. this can be similar to scanf() in C language. Can any one please help me ...
|
|||
|
input to TSL script in WINRUNNER
Hi,
I want to know whether we coukd give a run time input to winrunner. this can be similar to scanf() in C language. Can any one please help me out to achieve this scenario? -Regards |
| Sponsored Links |
|
|||
|
Re: input to TSL script in WINRUNNER
My preferred way is to use the timer functions within the CSOLIB2 library. This example formats the milliseconds into longer HH:MM:SS:ms presentation.
time_str_start = time_str(); # UNIX format "Tue Jun 11 11:45:05 2002" sync_timer(); start_timer(timer1); wait(1); # 1=1000 ms # replace with whatever you're timing. timer1ms=end_timer(timer1); time_str_end = time_str(); # UNIX format "Tue Jun 11 11:45:05 2002" timer1ms=86400002; #for debugging. msg=""; tx=timer1ms; if( tx > 8640000){ t=int(tx/8640000); msg=t&"days:"; tx = tx-(t*8640000); } if( tx > 360000){ t=int(tx/360000); msg=t&"hours:"; tx = tx-(t*360000); } if( tx > 6000){ t=int(tx/6000); msg=msg&t&"min:"; tx=tx-(t*6000); } if( tx > 1000){ t=int(tx/1000); msg=msg&t&"s:"; tx = tx-(t*1000); } if( msg == "" ){ msg=timer1ms&" ms"; }else{ msg=msg&tx&"ms ("&timer1ms&" ms)"; } pause( "... took "&msg& " from "&time_str_start&" to "&time_str_end); |
|
|||
|
Use user defined functions. For example, assume that you want to give username and password as input values. U can use the following steps.
1) Function call:userInputExample("aaaaaa","12345"); 2)Actual function: userInputExample(in username, in password); The username and passwords will be replaced by aaaaaa, 12345.Hope it clears your doubt. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Input and output | AnnieL4864 | VB.NET | 1 | 11-20-2007 04:12 AM |
| Can we assign input data from Notepad to the script? | Geek_Guest | QTP | 4 | 08-02-2007 01:35 PM |
| How can I use these parameter values in a WinRunner script | Geek_Guest | WinRunner | 0 | 07-06-2007 09:38 AM |
| Access file attached by TestDirector on a WinRunner Script | Geek_Guest | Test Director | 0 | 04-11-2007 01:47 PM |
| script in winrunner...? | gandra.2006 | WinRunner | 0 | 12-23-2006 02:14 AM |