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 handle, if popup title gets changed (not dynamic)?

nagarnagar Members
edited November -1 in Sahi - Open Source
Hi All,

Using Sahi, I click on a link which opens in a popup window. Let's say popup title is "Sahi Test". Then, I verify few links on that popup using,
_popup("Sahi Test")._isVisible(_link("xyz"));

then click on this link on the popup "Sahi Test"
_popup("Sahi Test")._click(_link("xyz"));

Now, once I click on xyz link, popup title gets changed from "Sahi Test" (say, "Welcome User") {but this cannot be hard coded, as any of the links can be clicked from the popup}.

Once the link "xyz" is open, I need to verify any html object on this. But this time, as the popup title is changed, I am unable to succeed.

I tried to get popup's new title also using, _title();
but that gets executed as:
_popup("Sahi Test")._title();

and hence, fails the execution.

If anyone has any idea, please share.


Regards,
nagar

Comments

  • ashokashok Members
    Try below code, it may work.

    _popup("/.*/")._title();
Sign In or Register to comment.