Clicking an element inside of an iFrame

5 posts, 0 answers
  1. Zach
    Zach avatar
    33 posts
    Member since:
    Sep 2014

    Posted 22 Sep 2014 Link to this post

    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. 


  2. Zach
    Zach avatar
    33 posts
    Member since:
    Sep 2014

    Posted 22 Sep 2014 in reply to Zach Link to this post

    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.
  3. Boyan Boev
    Admin
    Boyan Boev avatar
    1039 posts

    Posted 25 Sep 2014 Link to this post

    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
     
  4. Zach
    Zach avatar
    33 posts
    Member since:
    Sep 2014

    Posted 25 Sep 2014 in reply to Boyan Boev Link to this post

    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.
  5. Boyan Boev
    Admin
    Boyan Boev avatar
    1039 posts

    Posted 26 Sep 2014 Link to this post

    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
     
Back to Top