Results 1 to 3 of 3

Thread: input to TSL script in WINRUNNER

  1. #1
    Junior Member
    Join Date
    Feb 2008
    Answers
    1

    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


  2. #2
    Banned
    Join Date
    Oct 2007
    Answers
    173

    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);


  3. #3
    Junior Member
    Join Date
    May 2008
    Answers
    7

    Smile 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
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact