WinRunner Function

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

Questions by Param v Deshwal

Showing Answers 1 - 3 of 3 Answers

a_katiyar

  • Aug 21st, 2008
 

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

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions