This is a migrated thread and some comments may be shown as answers.

Clicking on a HTML dropdown list doesn't drop the list

1 Answer 36 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
hasantha
Top achievements
Rank 1
hasantha asked on 17 Jun 2014, 10:57 AM
We have hybrid android mobile application. In a certain UI(html file) in the application, there's a drop-down menu which needs to be clicked(automated) using a test script. I tried using  web.tap() and web.click(), but the drop-down list didn't drop as it should do. I couldn't find any other methods specifically made to perform an click operation/event on a dropdown list in this http://docs.telerik.com/platform/mobile-testing/api-reference/web page(Web API) . How do you achieve this?

1 Answer, 1 is accepted

Sort by
0
Shtilianov
Telerik team
answered on 20 Jun 2014, 09:14 AM
Hi hasantha,

Thank you for bringing this issue to us.

Can you try if the following will work on your side:

setSelectedValue should open the dropdown and select the item from the dropdown by its name as a string.
// the dropdown element
var dropdown = { 'id' : 'dropdown' };
 
web.setSelectedValue(dropdown, "value"),
// now for the verification, getSelectedValue should return the selected item as a string which can be asserted
 
web.getSelectedValue(dropdown, function(res){
     assert(res).equals("value");

I hope it helps.

Regards,
Shtilianov
Telerik
 
Test your Android and iOS apps against any device or browser with Telerik Mobile Testing. Part of the Telerik Platform.
 
Tags
General Discussions
Asked by
hasantha
Top achievements
Rank 1
Answers by
Shtilianov
Telerik team
Share this question
or