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.

pop-up window not closing

darsh_mehtadarsh_mehta Members
edited April 2011 in Sahi - Open Source
Hi,

I am creating new record in a pop-up window (page name: bp_un_0), upon saving the record, I get confirmation alert msg., and record is shown in same pop-up but with new name (say page name: bu_un_22). My line of code is not closing the pop-up window.

_popup("bp_un_0")._click(_link("Save"));
_wait(200, _span("msg"));
$strRecNo = get_recordnum("1");
_debug($strRecNo);
_click(_button("OK")); // Successfully clicks OK button on alert window.
_popup("/bp.*/")._click(_link("Close Window")); // Does not execute this step onwards.


I tried using _selectWindow("/bp.*/"); but it did not work.
Pls help. Thanks.

Comments

  • narayannarayan Administrators
    What happens when you click that "Close Window" link? Does it show a message saying that the web page is trying to close the window?

    Regards,
    Narayan
  • darsh_mehtadarsh_mehta Members
    edited April 2011
    Thanks for quick reply.

    I tried _popup("/bp.*/")._closeWindow(); as well, it did not work.

    On the statements: pane I don't get anything.
    On Sahi_Pro dashboard cmd window I see following:

    Rhino lib:Step >_sahi._debug("cfgu2user1");< did not complete in 150 seconds.
    Debug: cfgu2user1
    Rhino lib:Step >_sahi._popup("/bp.*/")._sahi._closeWindow();< did not complete i
    n 150 seconds.

    On stopping script execution, I get below:
    Apr 12, 2011 1:59:00 PM net.sf.sahi.command.CommandExecuter execute
    WARNING: commandClass = >net.sf.sahi.command.Player< commandMethod = >hasErrors<

    Apr 12, 2011 1:59:00 PM net.sf.sahi.command.CommandExecuter execute
    WARNING: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.sf.sahi.command.CommandExecuter.execute(CommandExecuter.java:55)
    at net.sf.sahi.LocalRequestProcessor.handleDyn(LocalRequestProcessor.jav
    a:65)
    at net.sf.sahi.LocalRequestProcessor.getLocalResponse(LocalRequestProces
    sor.java:38)
    at net.sf.sahi.ProxyProcessor.processLocally(ProxyProcessor.java:209)
    at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:86)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.NullPointerException
    at net.sf.sahi.command.Player.hasErrors(Player.java:277)
    ... 10 more
  • DwarFDwarF Members
    Any solution to this one?
Sign In or Register to comment.