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
What are the methods used in UFT to handle exceptions or run-time errors?
Define Error Pane of UFT?
How does qtp identify objects in the application?
What is the syntax for how to call one script from another?
If I change the property value at runtime is it effect is object repository?
Is there anyway to automatically update the Datasource name in Database Checkpoints object when we migrate tests to a new release?
Is any limitation to xml checkpoints?
What are the different types of qtp test assets and their extensions?
How to data driven test for Win objects in QTP ?
What are the types of object repository?
Hi ,Can any one pleas explain how to test splash objects using QTP?
How is the Bitmap checkpoint different from Image checkpoint?
Write the code for,In the page screen we have total 10 Links,out of these I have to click 9th link
in data driven testing for performing operations which method is easy from manual test data,keyword view,or from database.and why?
give me the code to save all messages of inbox of gmail into a folder and notepad