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.
Sahi assert popup exists when popup content not accesible
I have an issue.
I want to check if a popup is opened by my app.
So I have done something like this :
_assertExists(_popup("BCPW"));
But this doesn't working.
I have this error
_sahi._assertExists(_sahi._popup("BCPW"));< did not complete in 150 seconds.
I think's it's because my popup content is not available. (It's an intranet webpage, and on my test env I'am not on the intranet).
I have too this exception on my sahi console :
AVERTISSEMENT: commandClass = >net.sf.sahi.command.Player< commandMethod = >getC
urrentStep<
ao¹t 28, 2015 3:51:32 PM net.sf.sahi.command.CommandExecuter execute
AVERTISSEMENT: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor7.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:67)
at net.sf.sahi.LocalRequestProcessor.getLocalResponse(LocalRequestProces
sor.java:40)
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.StringIndexOutOfBoundsException: String index out of range:
-101
at java.lang.String.substring(Unknown Source)
at net.sf.sahi.rhino.ScriptRunner.getFromStep(ScriptRunner.java:253)
at net.sf.sahi.rhino.ScriptRunner.getPopupNameFromStep(ScriptRunner.java
:238)
at net.sf.sahi.rhino.ScriptRunner.getStepJSON(ScriptRunner.java:299)
at net.sf.sahi.command.Player.getCurrentStep(Player.java:135)
... 9 more
Someone, know, why this doesn't work?
I want to check if a popup is opened by my app.
So I have done something like this :
_assertExists(_popup("BCPW"));
But this doesn't working.
I have this error
_sahi._assertExists(_sahi._popup("BCPW"));< did not complete in 150 seconds.
I think's it's because my popup content is not available. (It's an intranet webpage, and on my test env I'am not on the intranet).
I have too this exception on my sahi console :
AVERTISSEMENT: commandClass = >net.sf.sahi.command.Player< commandMethod = >getC
urrentStep<
ao¹t 28, 2015 3:51:32 PM net.sf.sahi.command.CommandExecuter execute
AVERTISSEMENT: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor7.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:67)
at net.sf.sahi.LocalRequestProcessor.getLocalResponse(LocalRequestProces
sor.java:40)
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.StringIndexOutOfBoundsException: String index out of range:
-101
at java.lang.String.substring(Unknown Source)
at net.sf.sahi.rhino.ScriptRunner.getFromStep(ScriptRunner.java:253)
at net.sf.sahi.rhino.ScriptRunner.getPopupNameFromStep(ScriptRunner.java
:238)
at net.sf.sahi.rhino.ScriptRunner.getStepJSON(ScriptRunner.java:299)
at net.sf.sahi.command.Player.getCurrentStep(Player.java:135)
... 9 more
Someone, know, why this doesn't work?
Answers
Sahi need ")." after "_popup".
So you can't write _assert(_popup('name'))
but you must write _popup('name').<somethong>
I need to check if a popup have not been open. How can I do This?