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

HTML Select

2 Answers 74 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Paola
Top achievements
Rank 1
Paola asked on 21 May 2012, 11:12 PM
Hello everybody I hope you can help me with this.
I have an HTML Select list called "Year" that contains years from 1982 to 2013. 

What I want to do is to select every year because this action display information in another html select list, and select again and so on.

When I'm recording, I clicked on every year and everything seems to be fine because the information displays, but when I reproduce the steps it only select the element or year, but is not as a click, so the information doesn't appear.

I know that I can simulate a mouse click or an enter when I have selected the element, I already did that but this is not the correct way that I need it, I also tried to select by id, text, and URL (variable) but didn't work 

Also I noticed in the webtest.tstest that this particular step appears as a "select" and not as a click, I'm sending you the screenshots to see if you know what to do


Thanks in advance
Pao

2 Answers, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 22 May 2012, 09:20 AM
Hello Paola,
I would use a data-driven subtest to select each year (instead of clicking on each one individually):
http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/data-driven-testing.aspx

On the issue at hand, there's probably a javascript associated with the control.

Visual Event is a little tool I found which is real useful. It helps you determine what javascript events are associated with a particular control. This ties in with the following jQuery article:

http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/code-samples/html/jquery-events-do-not-fire.aspx

In the sample we use code to fire off the change event. However, any control can have a variety of events attached to it and you need to determine what those are if you want to fire them manually from code. This tools will help. It’s a “bookmarklet” so you just drag it in your bookmark bar. From there you’re ready to start using it as a browser add-on. Here’s a video demonstrating how to do that:
http://screencast.com/t/7rvJCdMJwV

All the best,
Stoich
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Paola
Top achievements
Rank 1
answered on 24 May 2012, 09:57 PM
Thank you so much this:Actions.InvokeScript("$(name='elementName').change()");  Really helped me out!!!
Tags
General Discussions
Asked by
Paola
Top achievements
Rank 1
Answers by
Stoich
Telerik team
Paola
Top achievements
Rank 1
Share this question
or