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.

From Sahi How To Open New Tab From Main Tab (Please See Detail Explanation..)

sanjusanju Members
edited May 2013 in Sahi - Open Source
Need Your Help On This Scenario I Am Recording Certain Behaviour In SAHI And This Requires Certain Action Action(Selecting DropDown) On A Particular Page.I Then Require To Do This In Multiple Tabs [Selecting Different DropDown In Each Tab].While Recording In SAHI This New Tab Behaviour Is Somehow Not A Part Of Script Which Ends Doing All Activity That I Am Doing On Different Tabs In One Single TAB Which Doesn't Suites My Requirement.
I wolud Like To Know That Is There Some Way I Can Handle This SAHI.
ANY Help Would Be Appreciated...

Thanks
Sanju Prajapati

Answers

  • sanjusanju Members
    please suggest something .........
  • Hi Sanju,
    This is actually a browser setting. You cannot change this behavior from javascript/Sahi.
  • You can work around the new tab problem by using _navigateTo($yourLink.href). But for doing things in multiple tabs simultaneously... Sahi can't do that imho

    Regards
    Wormi
  • sanjusanju Members
    thanks for reply Wormi
    I did opening of multiple tab using javascript and i am calling that in sahi but now the problem is
    in all tab i have multiple drop down and i need to make them by default selected any item and i am
    failing in that.
    complete code to open multiple tab and setting drop down:

    <<browser>
    function openLinks() {
    var link = "http://mphewdvdevh237.amrs.win.ml.com/POCIISRESET/Test.aspx";
    for (i = 0; i < 2; i++) {
    var child = window.open(link, '_blank');
    window.focus();

    if (child != null) {
    var $dd = child.document.getElementById('ddTest');
    //_setSelected(_select($id), "GPC_Online_External_Hosting_RelB");


    }
    }
    }
    </browser>
    _call(openLinks());

    Above code Working for multiple tab but failing in setting up default value for controls.
    i.e var $dd = child.document.getElementById('ddTest'); =>failing


    Any Help would be appriciated.....
Sign In or Register to comment.