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 use selectWindow() in Java

core5277core5277 Members
edited November -1 in Sahi - Open Source
I want to use Java to write test cases through Sahi.
I find that in Sahi mode there is a method call selectWindow() for select the window by name.
But I could not find the similar method in Sahi Java API.

Could you tell me how to implement the selectWindow() in Java?

Thank you very much.

Comments

  • SCKSCK Members
    Hi core5277,

    Window or iFrame?

    Can you try with browser.iframe("iframe-identifier").focus() ?

    Thanks!
  • What could be the equivalent java code for,
    _selectWindow("Window_Name");

    Thanks in advance.

    -Jayesh
  • Hi Jayesh,
    the equivalent java code would be
    browser.execute("_sahi._selectWindow('Window_Name');");
    

    Regards.
Sign In or Register to comment.