Get help with testing, discuss unit testing strategies etc.


Post by sqatester123 »

Hello,

I am trying to execute a test case using the web driver, however I am seeing an exception when I do so. Any idea what might be causing it?

Debug output:
siesta\bin\webdriver.bat https://127.0.0.1:8443/Siesta4/index.html --browser chrome --debug
[DEBUG] Dispatcher start
[DEBUG] Runner setup: a Siesta.Launcher.Runner.WebDriverNodeJS
[DEBUG] Dispatcher setup starting
[DEBUG] Trying to create a WebDriver instance for browser: chrome
[DEBUG] WebDriver instantiated successfully
[DEBUG] PageId: 1, method : getConfigInfo starting, args size: 16
[DEBUG] PageId: 1, method : getConfigInfo, took 0.014s, result size : 473
[DEBUG] Dispatcher setup completed, launching the suite
Launching test suite, OS: Windows, browser: Chrome 57.0.2987.133
[DEBUG] Launch runner, pagesCount: 1, max : 1, pages left: 1
[DEBUG] PageId: 1, method : launchAutomatedTests starting, args size: 144
[DEBUG] PageId: 1, method : launchAutomatedTests, took 0.015s, result size : 4
[DEBUG] Page polling has started
[DEBUG] PageId: 1, method : getAutomationState starting, args size: 2
[DEBUG] <Exception from launcher, pageId=1, sessionId=7b4a659930cf56988f0602d62ff91167>
[DEBUG]     While running small script: return Siesta.Harness.Browser.Automation.ScriptExecutor().acceptScriptChunk(3, 700000, "return (function (args) {\n                var me  = Siesta.my.activeHarness\n                \n                return me ? me[ 'getAutomationState' ].apply(me, a
[DEBUG]     Exception: WebDriverError: unknown error: Siesta is not defined
  (Session info: chrome=57.0.2987.133)
  (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10586 x86_64)
[DEBUG] </Exception from launcher>
[DEBUG] Exception #1 during `doPoll`, pageId=1: WebDriverError: unknown error: Siesta is not defined
  (Session info: chrome=57.0.2987.133)
  (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10586 x86_64)
[DEBUG] PageId: 1, method : getAutomationState starting, args size: 2
[DEBUG] <Exception from launcher, pageId=1, sessionId=7b4a659930cf56988f0602d62ff91167>
[DEBUG]     While running small script: return Siesta.Harness.Browser.Automation.ScriptExecutor().acceptScriptChunk(4, 700000, "return (function (args) {\n                var me  = Siesta.my.activeHarness\n                \n                return me ? me[ 'getAutomationState' ].apply(me, a
[DEBUG]     Exception: WebDriverError: unknown error: Siesta is not defined
  (Session info: chrome=57.0.2987.133)
  (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10586 x86_64)
[DEBUG] </Exception from launcher>
[DEBUG] Exception #2 during `doPoll`, pageId=1: WebDriverError: unknown error: Siesta is not defined
  (Session info: chrome=57.0.2987.133)
  (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10586 x86_64)
[DEBUG] Page close started: 1
[DEBUG] Launch runner, pagesCount: 0, max : 1, pages left:
[DEBUG] Trying to create a WebDriver instance for browser: chrome
[DEBUG] WebDriver instantiated successfully
[DEBUG] PageId: 3, method : launchAutomatedTests starting, args size: 144
[DEBUG] PageId: 3, method : launchAutomatedTests, took 0.014s, result size : 4
[DEBUG] Page polling has started
[DEBUG] PageId: 3, method : getAutomationState starting, args size: 2
[DEBUG] <Exception from launcher, pageId=3, sessionId=392fe7ae0d4ab3e710709aee9c0be313>
[DEBUG]     While running small script: return Siesta.Harness.Browser.Automation.ScriptExecutor().acceptScriptChunk(6, 700000, "return (function (args) {\n                var me  = Siesta.my.activeHarness\n                \n                return me ? me[ 'getAutomationState' ].apply(me, a
[DEBUG]     Exception: WebDriverError: unknown error: Siesta is not defined
  (Session info: chrome=57.0.2987.133)
  (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10586 x86_64)
[DEBUG] </Exception from launcher>
[DEBUG] Exception #1 during `doPoll`, pageId=3: WebDriverError: unknown error: Siesta is not defined
  (Session info: chrome=57.0.2987.133)
  (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10586 x86_64)
[DEBUG] PageId: 3, method : getAutomationState starting, args size: 2
[DEBUG] <Exception from launcher, pageId=3, sessionId=392fe7ae0d4ab3e710709aee9c0be313>
[DEBUG]     While running small script: return Siesta.Harness.Browser.Automation.ScriptExecutor().acceptScriptChunk(7, 700000, "return (function (args) {\n                var me  = Siesta.my.activeHarness\n                \n                return me ? me[ 'getAutomationState' ].apply(me, a
[DEBUG]     Exception: WebDriverError: unknown error: Siesta is not defined
  (Session info: chrome=57.0.2987.133)
  (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10586 x86_64)
[DEBUG] </Exception from launcher>
[DEBUG] Exception #2 during `doPoll`, pageId=3: WebDriverError: unknown error: Siesta is not defined
  (Session info: chrome=57.0.2987.133)
  (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10586 x86_64)
[WARN] Can not reach the end of the test: harness_case.js, test is marked as failed
[FAIL]  harness_case.js

[DEBUG] Recevied results for all tests in the suite, proceeding to finalization
0 passed, 0 failed assertions took 13.477s to complete
[DEBUG] Generating reports (if any)
[DEBUG] Reports processed (if any)
[DEBUG] Page close started: 3
Thanks in advance.

Post by nickolay »

Hi,

My guess is, that may be in the "index.html" you are referencing "siesta-all.js" using "http" protocol? Then it will be "mixed-content" since your harness is on "https" and Siesta will be blocked by browser.

In general it looks like "siesta-all.js" is not loaded in automation mode.

Post by sqatester123 »

My index.html page looked like this.
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

        <title>Siesta Harness</title>
        
        <link rel="stylesheet" type="text/css" href="siesta/resources/css/siesta-all.css">
        <script type="text/javascript" src="siesta/siesta-all.js"></script>
        <script type="text/javascript" src="harness.js"></script>
    </head>

    <body>
    </body>
</html>
I changed it to this, but I still see the same problem.
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

        <title>Siesta Harness</title>
        
        <link rel="stylesheet" type="text/css" href="https://127.0.0.1:8443/Siesta4/siesta/resources/css/siesta-all.css">
        <script type="text/javascript" src="https://127.0.0.1:8443/Siesta4/siesta/siesta-all.js"></script>
        <script type="text/javascript" src="https://127.0.0.1:8443/Siesta4/harness.js"></script>
    </head>

    <body>
    </body>
</html>

Post by nickolay »

Hm.. Can you try with plain http? May be a certificate problem.

Post Reply