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 is meant by function library?Public and private functions in function library? if private functions are applicable for only for the particular test means then y we have to add those to function library?
Does QTP run in any environment?
You will receive the mail in your outlook from client at night time to go ahead for the execution. Based on the mail you need to trigger the batch run. What is the QTP Code for this?
I recorded a Web App with a Oracle backend using QTP 9.5 and for some reason the scripts don't play back> What am I missing at this point. I recorded the same Apps under Sybase and they work great. This is Oracle 10g. Why won't my scripts play back.
What is keyword view in qtp?
What are table and db checkpoints?
what the difference between shared repository and per action repository?
How can I find out the cursor position through QTP suppose I am keep tabbing(Pressing the tab key continuously) and stoped at a position Now I want to find out where the cursor position is
what is profile tool?
Could i know how how to explain keyword driven framework in interview? If any body knows plz send the explanation.
What is meant by Output Value in UFT?
How to write business scripts using object repository with different scenarios
How many scripts did you have?
If you giving priority as p0, as a developer if I give priority as p2, What happens In user defined function ?
We stored into the objects OR and then write the scripting