Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ sahipro.com with your query.

Method setInitJS of TestRunner in Java is not working with Sahi Pro Starter and Sahi Pro

Hi community team.

I am using Sahi Pro Starter version 7.0.1 and Sahi Pro 7.5.0 to test the passing of variables to Sahi script from java class net.sf.sahi.test.TestRunner using method setInitJS(). However, when I start Sahi Pro Starter and execute the following Java program.

java.png
https://pastebin.com/3pAb5KEW

Sahi generates error ReferenceError: "$userName" is not defined. As described in the image below.

log_error.png

I am using the following Sahi script (demo.sah):

sahi_script.png
https://pastebin.com/QSQUR7dg

I think Sahi is not injecting the variables I set in TestRunner's initJS method. Also, this problem happens with Sahi Pro 7.5.0 and I have tried with browsers: chrome, firefox and ie. But when I execute the same Java program with Sahi OS 5.1, the script finish successfully.

Can you tell me is this is in issue in this version of Sahi or what can I do to solve it?.

I wait for your kind response, thanks.
Angel Gil
Sign In or Register to comment.