Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


I am new to testing. Can anyone send a sample test script in
which variables are used to automate the flight login page.



I am new to testing. Can anyone send a sample test script in which variables are used to automate t..

Answer / ak

Hi,
Any input which you give during recording can be used as
variable and you can then pass the values from different
sources (data tables, database, text files etc).
you can also use function and pass the input values as a
parameter, please see the sample below:

#Flight Reservation Login function
public function Login_FR (in sUserName, in sPassword)
{
#Local variable declaration
auto iRC = E_OK; #Return code

iRC = win_activate ("Login-FR");
iRC+= set_window ("Login-FR",1);
# Enter user name
if (E_OK != (iRC+= edit_set ("User Name", sUserName))
{
report_msg("Failed to enter the user name:"&
sUserName);
win_close ("Login-FR"); #close login window
return(iRC);
}
# Enter password - un-encrypted
if (E_OK != (iRC+= edit_set ("Password", sPassword))
{
report_msg("Failed to enter password: " &
sPassword);
win_close ("Login-FR");
return(iRC);
}
iRC+= button_press ("OK");
if (E_OK == win_exists("Error-Dialog",2))
{
report_msg("Invalid username/password");
win_close("Error-Dialog");
win_close ("Login-FR");
return(iRC);
}
if (E_OK != win_exists ("Flight Reservation",2))
{
report_msg ("Failed to open FR window");
return (iRC);
}
# no-issues
report_msg ("Successfully opened FR window");
return(iRC);
} #function ends

# Function call :
Login_FR ("mercury", "mercury");

Note: Logical names used in above function may not work in
your application, replace with actual names and use it.

Good Luck!
-AK

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More WinRunner Interview Questions

can we write exception handlers (object,tsl,pop-up) programatically then how should we insert this in the script?

2 Answers  


Friends,while installing winrunner,after setup unknowingly without generating license i opened winrunner.it didn't work,then i uninstalled wr ,and again installed properly ,generated license,opened winrunner .error msg :TMP environemnt variable is set to invalid folder.it must be set to valied folder.TMP is not a directory ,Exiting........ so kindly suggest me the solution

1 Answers  


Name the two modes of recording?

0 Answers  


what is def of MAINTEST

1 Answers   Exalt,


What is the use of gui map?

0 Answers  


what is the automation frame work ?

1 Answers   BeBo Technologies,


When Bitmap check point fails..How many windows will appear?

3 Answers   Symphony,


Tell me the function to move to the next row in a data table?

2 Answers   Accenture, Landscape Technologies,


how do you know which software with version(ex.msoffice)available in our system,using tsl functions

2 Answers   Satyam,


hye.when we do recording,objects r indentified by GUI map editor.and respective script is generated.But my problem is that in GUI map editor objects r not stored-not their description.I tried 'LEARN' option in GUI map,even it is not working.So that i can't run my script.Tell me solution Thank you.

2 Answers  


what is the difference between data driven test(ddt) and parametrization

7 Answers   Agile Software, CTS,


Is it possible to place a Logical name in a data table and can use that logical name in the script? Tell me with mentioning function names..?

1 Answers   Accenture,


Categories