Interview Questions

Winrunner with combo box

Mercury WinRunner FAQ

(Continued from previous question...)

Winrunner with combo box

Winrunner with combo box
Application has combo box which has some values need to select item 4 in first combo box to run the test Scenario. How to get the value of the selected combo box?

Use the GUI spy and compare the values in the SPY with the values in the GUI map for the physical attributes of the TComboBox_* objects. It appears to me that WinRunner is recording an attribute to differentiate combobox_1 from _0 that is *dynamic* rather than static. You need to find a physical property of all the comboboxes that is constant and unique for each combobox between refreshes of the app. (handle is an example of a BAD one). That's the property you need to have recorded in your GUI map (in addition to those physical properties that were recorded for the first combobox that was recorded.

Go through the following script, it will help .....

function app_data(dof)
	report_msg ("application data entry");
	set_window ("Flight Reservation", 6);
	list_get_items_count ("Fly From:" , flyfromc);
	list_get_items_count ("Fly To:" , flytoc);
	report_msg (flyfromc);
	report_msg (flytoc);
	for (i =0; i < flyfromc; i++)
	#for (j=0; j<flytoc-1; j++)
	for (j=0; j<flytoc-1; j++)
 menu_select_item("File;New Order");
edit_set ("Date of Flight:", dof);
 obj_type ("Date of Flight:","<kTab>");
 list_select_item ("Fly From:","#"i);
   # Item Number 0;
 obj_type ("Fly From:","<kTab>");
 list_select_item ("Fly To:", "#"j);
# Item Number 0;
 obj_mouse_click ("FLIGHT", 42, 20,LEFT);
	 set_window ("Flights Table", 1);
	 list_get_items_count ("Flight" ,flightc);
 list_activate_item ("Flight", "#"m);
# Item Number 1;
 set_window ("Flight Reservation",5);
 edit_set ("Name:", "ajay");
 button_press ("Insert Order");
	 }while ( a<flightc);
 report_msg (j);
	 report_msg (i);

(Continued on next question...)

Other Interview Questions