Hello! i am having two comboboxes.Each having 10 items in
it.when i select first item in first combobox,it is not
similar in the second combobox.for ex in first combo if it
is Hyderabad,in second it should be some chenai or some
other item .Write a VBSCRIPT for that?

Answer Posted / bfakruddin

We can do this in two ways...

1. Get all items from two combo boxes and store in two
separate arrays or in DataTable... "Your convenient process"

2. Validate one after the other dynamically in Loop...

I will keep one way here which I feel Logically better

2.

dim exp,act,cmb_1,cmb_2

cmb_1_cnt=browser("...").page("....").weblist
("...").getitemcount

for i=1 to cmb_1_cnt

exp=browser("...").page("...").weblist("...").getitem(i)

call cmb_2_Func()

reporter.reportevent micPass,"Test is Passed","Two
comboBoxes contain Different Items"

Next

Function cmb_2_Func()

cmb_2_cnt=browser("...").page("...").weblist
("...").getitemcount

for i=1 to cmb_2_cnt

act=browser("...").page("...").weblist("...").getitem

if (act=exp) then

reporter.reportevent micFail,"Test is Failed","Two
ComboBoxes contain Same Item"
End For

End if

Next

End Function

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

in a web page How to check and display a particular word from a paragraph?

2037


what is actually contain test report? can anybody post the test report

1470


What is the difference between run time object and test object?

573


suppose i login into gmail page after that i read all the messages (say 10 messages) i have to send (SAVE) the messages in Html,notepad and i have to replay(Compose) send the messages please give me the code and give mail id so that i can clear my question

1486


How to find Operating system information using QTP script?

567






What are the differences between quicktest professional (qtp) and winrunner?

568


1.Write a CRITICAL test cases for calculator ? 2.What is the difference b/w FRS and SRS documents ? 3.What is Component ? 4.What is object ? 5.what is the difference b/w static and dynamic descriptive programming ?

1577


How to execute the WR Script through QTP? I have WinRunner script with initialization script, common scripts, GUI AND functions. I connected WR through QTP with "call to WinRunner" option but I am getting problem after connecting to WinRunner i.e. showing "Do you want to quit now" with 'yes' and 'No' message box

1827


Hi All , How can we decicde for pariticular frame(DataDriven or Keword Driven)in Project? Thanks Balaji

1371


I have 5 save buttons in 5 tabs . The tabs are placed one after the other. My object repository have these added as 5 save buttons with name sav1, save 2, save 3 , save 4, save 5 .all are getting highlighted from OR but they are not getting clicked. After spying each button all the properties are same except First button Index 0 html id:=btnSaveTab1 outerhtml:=", Second button "html id:=btnSave "outerhtml:=", Third button "html id:=", outerhtml:=",

1353


any body plz send health care domain project to me with explanation any two modules on that project. mail_id: ranjith_99reddy@yahoo.co.in

3440


In QTP can we feed the out of one browser(internet explorer) as an input to the another browser(mozilla firefox)? If yes explain how to do it with an example.

1525


I want to capture data(using keyword) from msdos application using QTP?... Below is little work i could do on it... /* Set app=CreateObject("Wscript.shell") SystemUtil.run ("C:\Users\Agent\Desktop\pumpsim\PUMPSIM.EXE") Window(“PUMPSIM.EXE”).Activate wait(3) app.sendkeys "N" */ Thanks in advance...!!!

1435


What is CMMP and CMMH?

694


What is the qtp testing process?

594