Geeks Talk

Prepare for your Next Interview




input to TSL script in WINRUNNER

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


Go Back   Geeks Talk > Software Testing > WinRunner

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 02-07-2008
Junior Member
 
Join Date: Feb 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
v_srivatsava is on a distinguished road
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
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-12-2008
Banned
 
Join Date: Oct 2007
Location: Hyderabad
Posts: 176
Thanks: 2
Thanked 10 Times in 10 Posts
quality_quantity is on a distinguished road
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);
Reply With Quote
  #3 (permalink)  
Old 05-13-2008
Junior Member
 
Join Date: May 2008
Location: Chennai, India
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
dhanaprabhu is on a distinguished road
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.
Reply With Quote
Reply

  Geeks Talk > Software Testing > WinRunner


Thread Tools
Display Modes


Similar Threads

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


All times are GMT -4. The time now is 02:06 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved