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
Printable View
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
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.