GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Testing Tools  >  Winrunner

 Print  |  
Question:  WinRunner Function

Answer: What are the use of these functions in WinRunner?
1. substr
2. load
3. edit_get_list
4. invoke_application


August 08, 2008 04:26:01 #1
 a_katiyar   Member Since: August 2008    Total Comments: 7 

RE: WinRunner Function
 

1 - substr : extracts a substring from a string.
     syntax: substr (string,position,length);
                  string - string to be used
                  position - integer position from where you want to start extracting the string. (first character position is 1)
                  length - upto what point youwant to extract string
  for eg.  if you have a string say , str=winrunner; and you want to extract a part of that string then you can use.
 sMainStr = "Winrunner";
 sFinalStr = substr (sMainStr, 4, 8);
 report_msg ("sFinalStr");  # sFinalStr = "runne"


2- load: loads a compiled module into memory
     syntax: load(module_name);
You can make your scripts as compiled module (File->Test Properties; Test Type), say you have your code defined as different functions and you want to call these functions from/inside different scripts, for this you can make your script(or set of scripts) with all

your code as compiled module and "load" it before calling funcitions.

You can use "unload " at end of your test.


3 - invoke_application : invokes a window application from within a test script
     syntax: invoke_application(file,command_option,working_dir,show);
               file : full path of application
               command_option : command line options to apply (optional)
               working_dir : working directory for the specified application
               show :  how application appears when opened
      eg. invoke_application("calc","","",SW_SHOW); #opens win calculator application

4- edit_get_list : not sure if this function exist. 
    For what pupose you want to use this function,may be i can suggest any altenate function.

Hope you get some idea on above functions,for detailed usage refer WR "TSL Online Reference"

Regards,
- AK

     

 

Back To Question