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 do you close a Modal window during Sahi script replay?

tsivatsiva Members
edited June 2012 in Sahi - Open Source
In my application i need to click on a button to open up a modal window where i have to verify the fields and its values and then close the modal window and verify the rest of the field values on the original window. Sahi was able to identity all the controls on the modal window but doesn't close the window before checking the field values on the main window. I have written the below code and everything else works fine except closing the modal window. I appreciate any help if someone could help me to resolve this issue.

//Verifying Send MLA To field values...

Below first 3 lines code is for the main window verification and the next code is for verification on modal window and the last line is verifying back on the main window.

_highlight(_div("Send MLA To :"));
_highlight(_image("application_edit.png[1]"));
_click(_image("application_edit.png[1]"));

_highlight(_span("Contacts - MLA[1]"));
_highlight(_div("x-window-body x-window-body-default x-plain x-window-body-plain x-window-body-default-plain x-closable x-window-body-closable x-window-body-default-closable x-layout-fit[1]"));
_highlight(_span("Add New Contact[1]"));
_highlight(_span("Quick Search[2]"));
_click(_image("tool-1368-toolEl"));

_highlight(_heading2("Master Lease Agreement"));


Here is the error that i was getting at the script failure:
_click(_image("tool-1368-toolEl")); Error: The parameter passed to _click was not found on the browser [10450 ms] [02:23:30.128]

I am using Sahi Pro trail version,
IE 9 browser
Java code with extJS4.1

Comments

  • TheeranTheeran Members
    Hi tsiva,

    Try with

    _eval("window.close()");

    This might help you.

    Thanks,
    Theeran.
Sign In or Register to comment.