• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
#ifndef _GLOBALS_H#define _GLOBALS_H//--------------------------------------------------------------------// Include Files#include "lrun.h"#include "web_api.h"#include "lrw_custom_body.h"#include "orafuncs.h"//--------------------------------------------------------------------// Global Variables#endif // _GLOBALS_H//**************************************************************************************//// Script Name -- LoginTemplate// Author -- Julian Wilton// Purpose -- To act as a template script to perform logon to the application// -- It is designed to act with all business processes thatrequire NCA logon//// DateCreated-- 10th Oct 2008////Amendments//11 Oct 2008 -- Changed to take full URL as opposed to multiple correlation//13 Oct 2008-- Added replace code to deal with &//17 Oct 2008 -- Added error handling routines into init section//18 Oct 2008 -- Expanded text check section in login routine////27 Oct 2008 -- Sunil Girdhar - a) Fixed errorhandling() and cleaned up code.// b) Added call to errorhandling() in exception handler close().////06 Nov 2008-- Sunil Girdhar - Updated generic transaction names in Login() to have// Generic_Logon prefix////06 Nov 2008-- Sunil Girdhar - Added Logout() to template//**************************************************************************************Login(){web_cleanup_cookies();
 
web_reg_find("Text=Login","SaveCount=Home_Count",LAST);web_set_max_html_param_len("1024");lr_start_transaction("Generic_Logon_10_Oracle_Home_Page");web_url("AppsLocalLogin.jsp","URL=http://{ServerInstance}.bc.jsplc.net:8070/OA_HTML/AppsLocalLogin.jsp","Resource=0","RecContentType=text/html","Referer=","Snapshot=t1.inf","Mode=HTML",EXTRARES,"URL=cabo/images/cache/cghec.gif", ENDITEM,LAST);if (atoi(lr_eval_string("{Home_Count}")) > 0){lr_end_transaction("Generic_Logon_10_Oracle_Home_Page",LR_PASS);//lr_output_message("Welcome successful.");}else{lr_end_transaction("Generic_Logon_10_Oracle_Home_Page",LR_FAIL);lr_error_message("Generic_Logon_10_Oracle_Home_Pagefailed.");lr_think_time(60);lr_exit(LR_EXIT_MAIN_ITERATION_AND_CONTINUE,LR_FAIL);return(0);}lr_think_time(3);web_reg_find("Text={Responsibility}","SaveCount=Login_Count",LAST);lr_start_transaction("Generic_Logon_20_Login");
 
web_submit_form("fndvald.jsp_2","Snapshot=t4.inf",ITEMDATA,"Name=username", "Value={UserName}", ENDITEM,"Name=password", "Value={Password}", ENDITEM,LAST);if (atoi(lr_eval_string("{Login_Count}")) > 0){lr_end_transaction("Generic_Logon_20_Login", LR_PASS);//lr_output_message("Welcome successful.");}else{lr_end_transaction("Generic_Logon_20_Login", LR_FAIL);lr_error_message("Generic_Logon_20_Login failed with User %s Password%s",lr_eval_string("{UserName}"),lr_eval_string("{Password}"));lr_think_time(10);lr_exit(LR_EXIT_MAIN_ITERATION_AND_CONTINUE,LR_FAIL);return(0);}lr_think_time(10);web_reg_save_param("FullURL","LB=href=\"javascript:launchForm('","RB=')\" class=\"xd\">{StartScreen}","ORD=1",LAST);web_reg_find("Text={StartScreen}","SaveCount=StartScreen_Count",LAST);lr_start_transaction("Generic_Logon_30_Select_Responsibility");web_link("{Responsibility}","Text={Responsibility}","Snapshot=t5.inf",LAST);
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...