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

Clicking an element inside of an iFrame

4 Answers 169 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Zach
Top achievements
Rank 1
Zach asked on 22 Sep 2014, 02:42 PM
Hello! 

Trying to click on a list object inside of an iFrame. No errors are thrown but the click action never seems to occur!

ArtOfTest.WebAii.Core.Browser iFrame = man.ActiveBrowser.Frames[0];

Element listBox = iFrame.Find.ById("ListBox1");
Element bradtest = TelerikHelper.FindNestedElementByLoc(listBox, ("1"));

iFrame.Actions.Click(bradtest);


Does this look correct?  TelerikHelper.findNestedElement is a helper function I wrote. It simply finds children elements and is proven to work. I checked to make sure "bradtest" is the correct element I'm attempting to click and it is. 


4 Answers, 1 is accepted

Sort by
0
Zach
Top achievements
Rank 1
answered on 22 Sep 2014, 06:20 PM
More info - 

The element I'm trying to click inside of is an HTML listbox element. 
inside it are 3 <option> elements, I can't click on any of them.
0
Boyan Boev
Telerik team
answered on 25 Sep 2014, 11:49 AM
Hi Zach,

Is that a drop box actually?

If you directly click on an option which is inside of a closed dropbox it is an expected behavior.

You should first open the drop box and then click the option.

Could you please send us the DOM structure of the site so I can help you out with the code.

Hope to hear from you soon.

Regards,
Boyan Boev
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Zach
Top achievements
Rank 1
answered on 25 Sep 2014, 02:04 PM
I'll be darned.

It's called ListBox1 and has an ID of listbox and LOOKS like a asp.net listbox element...

It was a drop box though! I was able to get the behavior I wanted with  -   iFrame.Actions.SelectDropDown(listBox,"Brad Test");
and then invoking the script with  -   iFrame.Actions.InvokeEvent(listBox, ScriptEventType.OnChange);

Thanks for your help.
0
Boyan Boev
Telerik team
answered on 26 Sep 2014, 11:17 AM
Hello Zach,

I am happy to hear that.

If you need addtitional assistance, please let us know.

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