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
How can i initiate the objects to find uniquely in OR
HOw to add the recovery file at runtime to the test file .
Can you list some technologies that support qtp?
in a web page How to check and display a particular word from a paragraph?
what are all the fileds present in object repository?
How to give a call to another action from one action?
How to use reporter.report event in qtp ?
Hi, my requirement is to make a query in SQL using QTP. And i have to get the results of that query and i have to use those results for future testing. I created a driver but i dont know the code for using this Driver. please help me by providing the solution for y requorement
What is fragmentation and paging?
How to run an integrated test scenario using Multiple Actions? How to use the QTP Step Generator?
how could i download qtp in which i get add-in support for 'oracle' is there any way to get it? i finding but not getting pls help me out :)
wt is the use of multiple questions in QTP
How can you pass value one action to another action?
What is 'sleep' in sync point?
This is a question thats generally asked in every QTP interview. What were the problems that you faced during automation and how did you resolve them?