-
Junior Member
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
-
Banned
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);
-
Junior Member
Re: input to TSL script in WINRUNNER
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules