###################################################################################### # Load the data Sheet # Name of the Data Sheet as an input ###################################################################################### # Microsoft Excel - MiscRcpt ddt_close_all_tables(); #p_file_path - path passed to the script #file="..//DataSheet//AliasRcpt.xls"; file=""; file=p_file_path; rc=ddt_open(file,DDT_MODE_READ); if(rc==E_OK) report_msg("File Opened Successfully"); else pause("File Not opened"); #SetSearchpath #setvar("searchpath",""); ###################################################################################### # read the columns of the table - v_rc # Column Count of the table # # Observe in the watch window the pipe symbol shown for list_of_param # Copy paste it to a script # it Evaluates to " " ##### Row Count and Column Count # printf("Row Count is "&v_rc); # printf("Column count is "&col_cnt_of_param); ###################################################################################### ddt_get_row_count(file,v_rc); ddt_get_parameters(file,list_of_param,col_cnt_of_param); ###################################################################################### split(list_of_param,data_array," "); ###########################Array of Column Names ##################################### #For Each Row in the Sheet Print The Action ,Action Value,Variable Name,Expected Value #Row Number should start with 1 ###########################Array of Column Names ##################################### v_action=data_array[1]; v_action_value=data_array[2]; v_var_name=data_array[3]; v_expected_val=data_array[4]; v_wait=10; v_set_window=20; ###################################################################################### # Loop through each line of the data sheet ###################################################################################### for(t_rc=1;t_rc<=v_rc;t_rc++) { #SetRow #ddt_set_row(file,t_rc); # Not Mandatory ####Read the Action Action Value and Variable Name row_action=ddt_val_by_row(file,t_rc,v_action); t_row_action_value=ddt_val_by_row(file,t_rc,v_action_value); ######If special character like - exists - split by (-) replace by "\-" row_action_value=call_close "library\\escape_with_slash"(t_row_action_value); row_var_name=ddt_val_by_row(file,t_rc,v_var_name); row_expected_val=ddt_val_by_row(file,t_rc,v_expected_val); ###################################################################################### # printf("######### ROW : "&t_rc&"##########"); # printf("row_actionn is : "&row_action); # printf("row_action_value is : "row_action_value); # printf("row_var_name is : "row_var_name); # printf("row_expected_val is : "row_expected_val); ###### Based on action Switch the case # Keywords used in Action are # LAUNCH,SET,GET,NAVIGATE,CTRL,SKIP_DOWN,BUTTON_PRESS,CLOSE # VERIFY_STATUSBAR # VERIFY_ON_SCREEN ###################################################################################### switch(row_action) { case "LAUNCH": call_close "library//Launch"(row_action_value); break; case "SET": # Enhancement : to accept variable names with values as input call_close "library//Set"(row_action,row_action_value,row_var_name); break; case "GET": call_close "library//set_val_into_var"(row_action_value,row_var_name); #Feb14th - additional Return key event required for get to exit field value obj_type ("Term Class",""); #call_close "library//wait_for_action_complete"("Please Wait ..."); #Geb 16th call_close "library//wait_for_action_complete"(""); break; case "NAVIGATE": call_close "library//navigate"(row_action_value); break; case "CTRL": call_close "library//control_key_set_action"(row_action_value,row_var_name); call_close "library//wait_for_action_complete"(""); break; case "CTRL_NoEnter": call_close "library//control_key_set_action_NoEnter"(row_action_value,row_var_name); call_close "library//wait_for_action_complete"(""); break; case "SKIP_DOWN": call_close "library//skip_down"(); break; #Feb 21st, 2011, added by Jeffrey Guo case "SKIP_UP": call_close "library//skip_up"(); break; #feb 21st case"ESC": call_close "library//esc_key_action"(row_action_value); break; case "BUTTON_PRESS": call_close "library//button_press"(); break; case "VERIFY_STATUSBAR": call_close "library//verify_statusbar"(row_expected_val); break; case "VERIFY_ON_SCREEN": call_close "library//verify_on_screen"(row_expected_val); break; case "LOGOUT": call_close "library//logout"(); break; case "CLOSE": # wait(v_wait); call_close "library//close"(); break; # Mar 3rd, 2011,added by Jeffrey Guo case "VERIFY_VALUE": call_close "library//verify_value"(row_action_value,row_expected_val); break; default: report_msg("In Default"); }#End of Switch }#End of For ###################################################################################### # Close data tables ###################################################################################### ddt_close(file); ddt_close_all_tables(); ###################################################################################### # Print mobile captured values ###################################################################################### treturn; |