jenkinsantsahi

Sometimes Sahi Pro script on Jenkins (run with ant) can't find elements at all


Error - Logging exception: Step >_sahi._takePageScreenShot()< did not complete in 90 seconds.

This error appears with no logical reason. One time I run a build - all is fine. And other time - this error appears and build fails.

Here can see, that only two times, the script was really running. Not stuck on first. Here can see, that only 4 times from 15, the script was really running. Not stuck on first.

When I get this error it's on the first object that tries to find something in the browser. When I get this error it's on the first object that tries to find something in the browser.

Console log:

[sahi] Nov 07, 2017 2:16:10 AM in.co.sahi.distributed.DSahiRunner startNonDistributedRun
 [sahi] INFO: SuiteId : sahi_dde93c7c0a6640408608e800eeba549960a0
 [sahi] Nov 07, 2017 2:16:10 AM in.co.sahi.distributed.DSahiRunner startNonDistributedRun
 [sahi] INFO: URL : http://localhost:9999/_s_/dyn/in.co.sahi.command.Master_runNonDistributed?1=1&baseURL=http%3A%2F%2Fnewbrick.tietolatvia.lv%3A3650%2F&browserType=chrome&emailPasswordHidden=true&emailProp=&emailProperties=%2Fhome%2Fjenkins%2Fsahi%2Fsahi_pro_runner%2Fuserdata%2Fconfig%2Femail.properties&emailTrigger=success%2Cfailure&failedSuiteName=fail_chrome.dd.csv&host=localhost&isSendEmailS=false&isSingleSessionS=true&jsCodeCoverage=%24%7BjsCodeCoverage%7D&logsInfo=html%3A%2Fhome%2Fjenkins%2Fjenkins%2Fworkspace%2FPAIS1%2Freports%2Cjunit%3A%2Fhome%2Fjenkins%2Fjenkins%2Fworkspace%2FPAIS1%2Freports&port=9999&scriptsPathMaster=%2Fhome%2Fjenkins%2Fsahi%2Fsahi_pro_runner%2Fuserdata%2Fscripts&sendEmailPeriodicallyS=false&sendEmailPeriodicallyTime=&showPeriodicSummary=true&suiteId=sahi_dde93c7c0a6640408608e800eeba549960a0&suitePath=%2Fhome%2Fjenkins%2Fjenkins%2Fworkspace%2FPAIS1%2FPAIS1.dd.csv&threads=5
 [java] Nov 07, 2017 2:16:10 AM in.co.sahi.command.Master addNodes
 [java] INFO: syncNodes = false
 [java] Nov 07, 2017 2:16:10 AM in.co.sahi.distributed.DSuiteRunner addNode
 [java] INFO: Adding localhost:9999
 [java] Nov 07, 2017 2:16:10 AM in.co.sahi.datastore.SahiDB createTables
 [java] INFO: Check tables version
 [java] Nov 07, 2017 2:16:11 AM in.co.sahi.datastore.SahiDB createTables
 [java] INFO: versionFromDB=2017-04-21 21:05:44
 [java] Nov 07, 2017 2:16:11 AM in.co.sahi.datastore.SahiDB createTables
 [java] INFO: version=2017-04-21 21:05:44
 [java] Nov 07, 2017 2:16:11 AM in.co.sahi.datastore.SahiDB createTables
 [java] INFO: At current version. No changes were done.
 [java] Nov 07, 2017 2:16:11 AM in.co.sahi.datastore.SahiDB createTables
 [java] INFO: {result: [["SAHIKEY","SAHIVALUE"],["dbVersion","89"],["versionNo","2017-04-21 21:05:44"]]}
 [java] Nov 07, 2017 2:16:11 AM in.co.sahi.datastore.SahiDB createTables
 [java] INFO: Finished preparing report tables: 445ms
 [java] Nov 07, 2017 2:16:11 AM net.sf.sahi.test.ProcessHelper execute
 [java] INFO: env DISPLAY=:1 google-chrome --no-default-browser-check --no-first-run --start-maximized --user-data-dir=/home/jenkins/sahi/sahi_pro_runner/userdata/browser/chrome/profiles/sahi0 --proxy-server=127.0.0.1:9999 --disable-popup-blocking --always-authorize-plugins --allow-outdated-plugins --enable-npapi --disable-translate --no-managed-user-acknowledgment-check --disable-session-crashed-bubble --incognito http://sahi.example.com/_s_/dyn/Player_auto?startUrl=http%3A%2F%2Fnewbrick.tietolatvia.lv%3A3650%2F__SahiAmpersandSahi__sahisid=sahi_dde93c7c0a6640408608e800eeba549960a0sahix6cb39e7b0cb3f0486e09b270f80b45ed9098x__SahiAmpersandSahi__isSingleSession=true
 [java] Nov 07, 2017 2:16:11 AM net.sf.sahi.test.TestLauncher execute
 [java] INFO: #### Running Script: /home/jenkins/jenkins/workspace/PAIS1/Scen01.sah
 [java] Nov 07, 2017 2:16:11 AM net.sf.sahi.test.ProcessHelper$PIDGatherer run
 [java] INFO: PIDs: [32001, 32017, 32020, 32023, 32058, 32060]; 351 ms
 [sahi] Nov 07, 2017 02:16:11 AM STARTED: Scen01.sah BROWSER: chrome
 [sahi] Nov 07, 2017 02:16:11 AM Testcases: 0/0, Scripts: 0/0 BROWSER: chrome
 [java] Rhino lib: startMode = BROWSER
 [java] Rhino lib:Setting mode: BROWSER
 [java] Nov 07, 2017 2:16:21 AM net.sf.sahi.RemoteRequestProcessor processHttp
 [java] WARNING: Returning CannotConnectResponse for: https://ssl.gstatic.com/safebrowsing/csd/client_model_v5_variation_0.pb
 [java] Nov 07, 2017 2:16:21 AM net.sf.sahi.RemoteRequestProcessor processHttp
 [java] WARNING: Returning CannotConnectResponse for: https://ssl.gstatic.com/safebrowsing/csd/client_model_v5_ext_variation_0.pb
 [java] Rhino lib:/home/jenkins/jenkins/workspace/PAIS1/Page/Base.sah already included.
 [java] Rhino lib:/home/jenkins/jenkins/workspace/PAIS1/Page/Base.sah already included.
 [java] Rhino lib:/home/jenkins/jenkins/workspace/PAIS1/Page/Base.sah already included.
 [java] Rhino lib:/home/jenkins/jenkins/workspace/PAIS1/Page/Base.sah already included.
 [java] Rhino lib:/home/jenkins/jenkins/workspace/PAIS1/Page/Order.sah already included.
 [java] Rhino lib:/home/jenkins/jenkins/workspace/PAIS1/Page/Base.sah already included.
 [java] Rhino lib:Step >_sahi._takePageScreenShot()< did not complete in 90 seconds.
 [java] message = ALREADY_LOGGED (RhinoScriptRunner.run#1660)
 [java] token = ALREADY_LOGGED (RhinoScriptRunner.run#1660)
 [java] Nov 07, 2017 2:19:10 AM net.sf.sahi.RemoteRequestProcessor processHttp
 [java] WARNING: Returning CannotConnectResponse for: https://safebrowsing.google.com/safebrowsing/downloads?client=googlechrome&appver=58.0.3029.110&pver=3.0&key=AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw&ext=0
 [java] Nov 07, 2017 2:19:10 AM net.sf.sahi.RemoteRequestProcessor processHttp
 [java] WARNING: Returning CannotConnectResponse for: https://alt2-safebrowsing.google.com/safebrowsing/downloads?client=googlechrome&appver=58.0.3029.110&pver=3.0&key=AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw
 [java] Nov 07, 2017 2:20:10 AM net.sf.sahi.RemoteRequestProcessor processHttp
 [java] WARNING: Returning CannotConnectResponse for: https://safebrowsing.google.com/safebrowsing/downloads?client=googlechrome&appver=58.0.3029.110&pver=3.0&key=AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw&ext=0
 [java] Nov 07, 2017 2:20:10 AM net.sf.sahi.RemoteRequestProcessor processHttp
 [java] WARNING: Returning CannotConnectResponse for: https://alt2-safebrowsing.google.com/safebrowsing/downloads?client=googlechrome&appver=58.0.3029.110&pver=3.0&key=AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw
 [java] Rhino lib:Step >_sahi._takePageScreenShot()< did not complete in 90 seconds.
 [sahi] Nov 07, 2017 02:21:16 AM FAILED: Scen01.sah BROWSER: chrome
 [sahi] Nov 07, 2017 02:21:16 AM Testcases: 0/1, Scripts: 0/2 BROWSER: chrome

Do you have had this error? How you get ridof it?


Solution

  • There is no reliable way to get rid of it. The issue is pretty old, have a look at the related forum entries https://www.google.com/search?safe=off&ei=A5YCWomKH4P0aJSZl8gP&q=_sahi+did+not+complete+site%3Asahipro.com

    you might decrease the frequency of this issue by adjusting some properties in your sahi.properties

    # Script execution params
    
    #Time (in milliseconds) delay between steps
    script.time_between_steps=100
    #Time (in milliseconds) delay between retries once an error occurs
    script.time_between_steps_on_error=2000
    #Number of retries once an error occurs
    script.max_reattempts_on_error=5
    #Number of cycles Sahi will wait for the page to load before it proceeds with execution
    #Time spent is (script.max_cycles_for_page_load x script.time_between_steps) milliseconds
    script.max_cycles_for_page_load=1200
    #No of times Sahi should wait for stability of AJAX and page loads before continuing. min value is 1
    script.stability_index=5
    

    though in my experience, this just increases the time till a script inevitably fails .