I am trying to write a script for this page using straight webaii (not using recording feature in vs) for this page
http://www.letthememoriesbegintour.com/index.php?view=form
I want to select a value from the county ddl "Canada" (and I can) but it will not cause the update of the state ddl to occure so it gets filled with proviences.
any idea?
5 Answers, 1 is accepted
0
Hi Andrew,
You must add code to manually fire the jQuery event so subsequent dependent drop-downs are properly populated. Here is sample code that works against that site:
For more information, please read this article.
Greetings,
Anthony
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
You must add code to manually fire the jQuery event so subsequent dependent drop-downs are properly populated. Here is sample code that works against that site:
Manager.LaunchNewBrowser();
ActiveBrowser.NavigateTo(
"http://www.letthememoriesbegintour.com/index.php?view=form"
);
HtmlSelect country = Find.ByExpression<HtmlSelect>(
"id=country"
);
//Scroll the browser so we can visually confirm the drop-down selections
country.ScrollToVisible();
country.SelectByValue(
"CA"
);
//Manually invoke the jQuery event. You can reuse this line and change the ID to match the applicable control.
Actions.InvokeScript(
"$('#country').change()"
);
HtmlSelect state = Find.ByExpression<HtmlSelect>(
"id=state"
);
state.SelectByValue(
"Yukon"
);
//Short pause to visually confirm the drop-down selections were correctly made
System.Threading.Thread.Sleep(2000);
For more information, please read this article.
Greetings,
Anthony
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Andrew
Top achievements
Rank 1
Veteran
Iron
answered on 19 Sep 2011, 06:06 PM
thanks for your help
0

Andrew
Top achievements
Rank 1
Veteran
Iron
answered on 19 Sep 2011, 06:17 PM
i pased this code into mine:
Actions.InvokeScript("$('#country').change()");
but in vs is shows as underline and the tooltip says:
C#: There is no sucj reference available here
do I need to ref a new assembly
Actions.InvokeScript("$('#country').change()");
but in vs is shows as underline and the tooltip says:
C#: There is no sucj reference available here
do I need to ref a new assembly
0

Andrew
Top achievements
Rank 1
Veteran
Iron
answered on 19 Sep 2011, 06:24 PM
.
0

Andrew
Top achievements
Rank 1
Veteran
Iron
answered on 19 Sep 2011, 06:31 PM
got it,
browser.Actions.InvokeScript("$('#country').change()");
browser.Actions.InvokeScript("$('#country').change()");