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.

How to open new URL in a new browser

SamsirsameerSamsirsameer Members
edited November -1 in Sahi - Open Source
Hi,

In middle of my script, when I use _navigate("URL"); then the URL is opened in the same browser in which he script is running.

Is there anyway to open th e URL in a new browser and so that we can shift between these browsers whenever required (as per the scripts)

Example:

Suppose we are logging in GMAIL and we are doing some operations. In between We want to connect to Yahoomail in another browser and verify the emails. Then we want to shift back to GMAIl and verify some more emails.... like that......


Thanks,
Samsirsameer.

Comments

  • johnjohn Members
    have you considered just running the steps in sequence?

    To continue your example you would get
    logonToGmail();
    sendMailFromGmail();
    logoutGmail();
    
    logonYahoo();
    checkYahooMail();
    logougYahoo();
    
    It'll be pretty easy to do - you'll quickly build up a library of functions and be able to 'chain' new tests together.

    I accept that it will increase the time to run a test - but the simplicity of it will mean your tests will be robust. (and it'll give you a chance to get a cup of coffee!)
  • narayannarayan Administrators
    Sameer,

    I would agree with John on that. But there IS something that you can do. You can use
    _call(window.open(yahooURL, "MyWindowName"));
    // You can access the popup window via _popup
    _popup("MyWindowName")._click(...);
    
    But, again, as John says, keep it simple for better maintainability.

    Regards,
    Narayan
Sign In or Register to comment.