18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

iFrames?

lesSheppardlesSheppard Members
edited November -1 in Sahi - Open Source
Hi Narayan,

Just a quick question to ask if support for iFrames on different domains is something that's in the Sahi roadmap? And if it is, do you have any thoughts about when it'll be available?

There are some pages I need to test which consist of an iFrame from localhost and one from a separate server. I can test them manually for now, but it would be nice to incorporate them into the suite of Sahi tests we have, at some stage in the future :)

Cheers,
Les.

Comments

  • narayannarayan Administrators
    Les,

    It is definitely in the road map, though it got delayed a bit because of other priorities. Even now, if you can hand code your scripts, you should be able to replay them.

    Regards,
    Narayan
  • Thanks Narayan,

    I haven't tried yet, as I assumed it wouldn't work, but I do hand code the scripts, so I'll have a go at accessing the iframe :)

    Cheers,
    Les.
  • Hi Narayan,

    I've tried extending my scripts to access the elements within the iFrame (on a different domain to the rest of the page), which works fine for clicking buttons etc, but when I try to (for example) check if an element contains text, I get an "undefined" on the element.

    For reference, the command I am using is:

    _containsText(_span("_productButton1"),"1 Hr Bundle");

    If I use the Sahi controller, I can <ctrl> <alt> double click on the iFrame and test the expression, which returns true, but if I <ctrl> <alt> double click on a different part of the page (i.e. not on the iframe), the expression evaluates as undefined.

    So it appears the iFrame must be in scope for Sahi to evaluate element contents - is there any way I can do this via scripting?

    Cheers,
    Les.
Sign In or Register to comment.