18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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.
Problem with multiple windows and regex
Hello all,
I have a problem using SAHI OS (Build: 2013-04-29) and Enovia V6. I am using firefox for the tests.
I am working with Enovia V6, which has a web interface.
Enovia uses different windows with some random window name. The values look like ModalDialog plus random number: ModalDialog1234567890 and are not displayed.
My problem is that when you have more than one window, SAHI cannot address the window using _popup().
If you have only one window you can get it using
_popup("/ModalDialog.*/")
My idea was to use regex to exclude the first window so that only the second window would be left.
I store the first window name in a variable and build a regex with this:
_popup("/ModalDialog.*/")._set($dialog, window.name);
$dialog = $dialog.slice(11, $dialog.length);
$regex = "ModalDialog(?!" + $dialog + ").*";
_popup($regex)._setValue(_textbox("txtName"), "123");
The regex looks like:
ModalDialog(?!1234567890).*
Unfortunatly SAHI does not like this. I get following error:
Window/Domain not found: popupNameFromStep=ModalDialog(?!138200247846; derivedName=; windowName=; windowTitle=Dassault Systemes ENOVIA Corp.; wasOpened=0; domain= at 17.10.2013 11:35:02
It looks to me that the regex is not displayed correctly somehow.
So I hope someone can help me out with this problem here
Thanks in advance
Mario
I have a problem using SAHI OS (Build: 2013-04-29) and Enovia V6. I am using firefox for the tests.
I am working with Enovia V6, which has a web interface.
Enovia uses different windows with some random window name. The values look like ModalDialog plus random number: ModalDialog1234567890 and are not displayed.
My problem is that when you have more than one window, SAHI cannot address the window using _popup().
If you have only one window you can get it using
_popup("/ModalDialog.*/")
My idea was to use regex to exclude the first window so that only the second window would be left.
I store the first window name in a variable and build a regex with this:
_popup("/ModalDialog.*/")._set($dialog, window.name);
$dialog = $dialog.slice(11, $dialog.length);
$regex = "ModalDialog(?!" + $dialog + ").*";
_popup($regex)._setValue(_textbox("txtName"), "123");
The regex looks like:
ModalDialog(?!1234567890).*
Unfortunatly SAHI does not like this. I get following error:
Window/Domain not found: popupNameFromStep=ModalDialog(?!138200247846; derivedName=; windowName=; windowTitle=Dassault Systemes ENOVIA Corp.; wasOpened=0; domain= at 17.10.2013 11:35:02
It looks to me that the regex is not displayed correctly somehow.
So I hope someone can help me out with this problem here
Thanks in advance
Mario