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

Actions on HTML content within Silverlight

4 Answers 50 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Harinee
Top achievements
Rank 1
Harinee asked on 11 Mar 2015, 09:21 AM
Hi,

We have a Silverlight application hosting an iframe within it.

Finding element works well. But actions are giving me a tough time.
I am trying to click or scroll to an HTML element using :

1) Browser Actions:
Browser.Actions.ScrollToVisible(element);
Browser.Actions.Click(element);

This throws an exception.

2) Html control class 
element = frame.Find.ByExpression<HtmlInputRadioButton>("class=FICheckRadio");
element.InvokeEvent(ScriptEventType.OnClick);

This does highlight the radio button, and does not throw any exception. BUT does not actually click on the element.

Is there another way to act on the elements within HTML withing Silverlight?




4 Answers, 1 is accepted

Sort by
0
Harinee
Top achievements
Rank 1
answered on 11 Mar 2015, 09:58 AM
Ha!
Resolved sooner than I thought.

element= frame.Find.ByAttributes<HtmlInputRadioButton>("class=FICheckRadio");
element.Check(true, true, true);

But wondering why element.InvokeEvent(ScriptEventType.OnClick) didn't work
0
Ivaylo
Telerik team
answered on 16 Mar 2015, 07:01 AM
Hello Harinee,

Glad to hear you were able to solve the problem experienced.

Regarding element.InvokeEvent(ScriptEventType.OnClick) not working, I guess this is expected, since this is supposed to trigger javascript event, not to perform actual click, check in your case.

Regards,
Ivaylo
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Harinee
Top achievements
Rank 1
answered on 19 Mar 2015, 04:54 AM
Hi,

Thank you for the response.
Just one more question:
Technically, what is difference between element.Check(true, true) and element.Click(true)
in this case?
0
Ivaylo
Telerik team
answered on 19 Mar 2015, 01:27 PM
Hello Harinee,

The first boolean value is whether the radio button is checked, the second boolean value is whether to invoke on click event.

Refer to the screenshot attached for more clarity.

Regards,
Ivaylo
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Harinee
Top achievements
Rank 1
Answers by
Harinee
Top achievements
Rank 1
Ivaylo
Telerik team
Share this question
or