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.

unable to run suite using batch file.

nagarjunnagarjun Members
edited November -1 in Sahi - Open Source
hi

my web application is running in popupwindow with some name.

when i run suite file using batch. i am getting this error

SahiNotMyWindowException: Window with name [TEST] not found

how can i resolve it.

Thanks in advance.
Nagarjun.P

Comments

  • narayannarayan Administrators
    Hi Nagarjun,

    When running as a suite, can you check if the window is getting opened at all? I suspect that a popup blocker may be kicking in and blocking that window.

    Also try running it with only one thread at a time.

    Regards,
    Narayan
  • nagarjunnagarjun Members
    edited February 2010
    Hi Narayan

    window was opened and tried with single thread only.But still i was getting same error

    SahiNotMyWindowException: Window with name [TEST] not found.

    please reply as soon as possible

    regards,
    Nagarjun.p
  • Hi Narayan

    window was opened and tried with single thread only.But still i was getting same error

    SahiNotMyWindowException: Window with name [TEST] not found.

    My batch file content

    cd\
    java -cp d:\sahi\lib\ant-sahi.jar net.sf.sahi.test.TestRunner D:/sahi/userdata/scripts/TestScripts/Test.suite "C:\Program Files\Mozilla Firefox\firefox.exe" http://10.50.0.136:8080/rez2g/ default 10.50.0.136 9999 1 firefox.exe

    please reply as soon as possible

    regards,
    Nagarjun.p
  • narayannarayan Administrators
    Hi Nagarjun,

    Could you post your script here? If not you can email me the script.

    Regards,
    Narayan
  • Hi Narayan,

    Test.suite contains AANavigationSelfTest.sah this file contains

    _include("/NavigationController.sah");

    var $username = "superuser";
    var $password = "superuser";

    testLogin($username, $password);
    NavigationController.sah contains

    function testLogin($username,$password){
    if (_condition((_popup("VTONG")._exists(_heading1("Anmeldung"))))) {

    _popup("VTONG")._setValue(_textbox("DlgAnmeldungForm:txtUserId"),$username );
    _popup("VTONG")._setValue(_password("DlgAnmeldungForm:txtPassword"),$password);
    _popup("VTONG")._click(_submit("OK"));
    }
    }
    Note :above all files are in same Directory.
    when i run Test.suite with batch file below

    cd\
    java -cp d:\sahi\lib\ant-sahi.jar net.sf.sahi.test.TestRunner D:/sahi/userdata/scripts/Riester2gSahiScripts_V1/Test.suite "C:\Program Files\Mozilla Firefox\firefox.exe" http://10.50.0.136:8080/rez2g/ default 10.50.0.136 9999 1 firefox.exe

    i am getting this error

    SahiNotMyWindowException: Window with name [Test] not found

    regards,
    Nagarjun
  • Hi Narayan.

    could you give any solution for this problem.


    regards,
    Nagarjuna.P
  • narayannarayan Administrators
    Hi Nagarjun,

    There seems to be a bug in Sahi which makes this not work properly.

    Here is a workaround till we fix it in our next release.
    
    function testLogin($username,$password){
        var $condition = false;
        _popup("VTONG")._call(_sahi.setServerVar("\$condition", _exists(_heading1("Anmeldung"))));
        $condition = _sahi.getServerVar("\$condition");
    
        
        if ($condition) {
        _popup("VTONG")._setValue(_textbox("DlgAnmeldungForm:txtUserId"),$username );
        _popup("VTONG")._setValue(_password("DlgAnmeldungForm:txtPassword"),$password);
        _popup("VTONG")._click(_submit("OK"));
        }    
    }
    
    


    Regards,
    Narayan
Sign In or Register to comment.