Page 1 of 1

Datadriven testing for selecting dropdown list value

Posted: Thu Sep 27, 2012 9:17 pm
by vnet
I am using datadriven testing and using csv file for passing my data. My problem is one of the values I am suppose to select is from a dropdown list and rest are input text field. I am not sure how to do this using data driven approach. I can record the entire test by selecting value and entering data but want to avoid it. Any suggestions?

Thanks,
vnet

Re: Datadriven testing for selecting dropdown list value

Posted: Fri Sep 28, 2012 12:18 am
by IanF
What happens if you use the Presskeys method? This is what I use for dropdowns and it works.

Re: Datadriven testing for selecting dropdown list value

Posted: Fri Sep 28, 2012 12:47 am
by vnet
Did you mean keysequence? I can't since my dropdown is 'readonly' (meaning I can't type in the values in the list. What worked for me is setValue'sSelectItemIndex(I pass the index in the csv file) and keysequence return.

Now I have new problem, there are scenarios where I dont select anything from the dropdown (I have 2 operators and 2 numbers to get range). I am not sure what to pass in the csv file for no value (I tried null just ; but nothing works). Any help would be appreciated.

Re: Datadriven testing for selecting dropdown list value

Posted: Fri Sep 28, 2012 12:55 am
by vnet
Never mind I got the solution. Since I was acessing my drop down based on index, using -1 in the csv did the trick :)