{"action":"created","issue":{"url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/1933","repository_url":"https://api.github.com/repos/nightwatchjs/nightwatch","labels_url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/1933/labels{/name}","comments_url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/1933/comments","events_url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/1933/events","html_url":"https://github.com/nightwatchjs/nightwatch/issues/1933","id":383918385,"node_id":"MDU6SXNzdWUzODM5MTgzODU=","number":1933,"title":"Demo test fails, google.com lacks <button[name=btnG]>","user":{"login":"xurizaemon","id":105608,"node_id":"MDQ6VXNlcjEwNTYwOA==","avatar_url":"https://avatars2.githubusercontent.com/u/105608?v=4","gravatar_id":"","url":"https://api.github.com/users/xurizaemon","html_url":"https://github.com/xurizaemon","followers_url":"https://api.github.com/users/xurizaemon/followers","following_url":"https://api.github.com/users/xurizaemon/following{/other_user}","gists_url":"https://api.github.com/users/xurizaemon/gists{/gist_id}","starred_url":"https://api.github.com/users/xurizaemon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xurizaemon/subscriptions","organizations_url":"https://api.github.com/users/xurizaemon/orgs","repos_url":"https://api.github.com/users/xurizaemon/repos","events_url":"https://api.github.com/users/xurizaemon/events{/privacy}","received_events_url":"https://api.github.com/users/xurizaemon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-23T20:03:24Z","updated_at":"2018-11-23T20:09:48Z","closed_at":null,"author_association":"NONE","body":"Hi there! I've read instructions, searched issue queue and hopefully done what I need to make your job easier. This is probably a docs/marketing issue, and ultimately due to NightwatchJS not being in control of Google's DOM. \r\n\r\n**For me, the example test on the front page of nightwatchjs.org fails because there is no element `<button[name=btnG]>` on https://google.com**\r\n\r\n## Expectations\r\n\r\n* I expect that the example test will pass\r\n* I see that the example test fails\r\n\r\n## Proposed resolution\r\n\r\n* Update the example test with one that works, OR if suitable replace it with a test that depends on HTML you're in control of.\r\n\r\n## Versions\r\n\r\n* nightwatch v0.9.21\r\n* nodejs v8.11.3\r\n* ubuntu 18.04\r\n* selenium 3.141.0\r\n\r\n## Test code\r\n\r\nObtained just now from front page of https://nightwatchjs.org\r\n\r\n```js\r\nmodule.exports = {\r\n  'Demo test Google' : function (client) {\r\n    client\r\n      .url('http://www.google.com')\r\n      .waitForElementVisible('body', 1000)\r\n      .assert.title('Google')\r\n      .assert.visible('input[type=text]')\r\n      .setValue('input[type=text]', 'rembrandt van rijn')\r\n      .waitForElementVisible('button[name=btnG]', 1000)\r\n      .click('button[name=btnG]')\r\n      .pause(1000)\r\n      .assert.containsText('ol#rso li:first-child',\r\n        'Rembrandt - Wikipedia')\r\n      .end();\r\n  }\r\n};\r\n```\r\n\r\n## Output\r\n\r\n```text\r\n08:56 $ ~/Projects/example/node_modules/nightwatch/bin/nightwatch --verbose tests/NightWatch/google.js \r\n\r\n[Night Watch / Google] Test Suite\r\n=====================================\r\n\r\nRunning:  Demo test Google\r\nINFO Request: POST /wd/hub/session \r\n - data:  {\"desiredCapabilities\":{\"browserName\":\"chrome\",\"javascriptEnabled\":true,\"acceptSslCerts\":true,\"platform\":\"ANY\",\"marionette\":true,\"name\":\"Night Watch / Google\"}} \r\n - headers:  {\"Content-Type\":\"application/json; charset=utf-8\",\"Content-Length\":160}\r\nINFO Response 200 POST /wd/hub/session (1579ms) { status: 0,\r\n  sessionId: 'c063102d2b6f37a80a399192e9005705',\r\n  value: \r\n   { acceptInsecureCerts: false,\r\n     acceptSslCerts: false,\r\n     applicationCacheEnabled: false,\r\n     browserConnectionEnabled: false,\r\n     browserName: 'chrome',\r\n     chrome: \r\n      { chromedriverVersion: '2.44.609551 (5d576e9a44fe4c5b6a07e568f1ebc753f1214634)',\r\n        userDataDir: '/tmp/.org.chromium.Chromium.c8kMYE' },\r\n     cssSelectorsEnabled: true,\r\n     databaseEnabled: false,\r\n     'goog:chromeOptions': { debuggerAddress: 'localhost:45183' },\r\n     handlesAlerts: true,\r\n     hasTouchScreen: false,\r\n     javascriptEnabled: true,\r\n     locationContextEnabled: true,\r\n     mobileEmulationEnabled: false,\r\n     nativeEvents: true,\r\n     networkConnectionEnabled: false,\r\n     pageLoadStrategy: 'normal',\r\n     platform: 'Linux',\r\n     rotatable: false,\r\n     setWindowRect: true,\r\n     takesHeapSnapshot: true,\r\n     takesScreenshot: true,\r\n     unexpectedAlertBehaviour: 'ignore',\r\n     version: '70.0.3538.77',\r\n     webStorageEnabled: true,\r\n     'webdriver.remote.sessionid': 'c063102d2b6f37a80a399192e9005705' } }\r\nINFO Got sessionId from selenium c063102d2b6f37a80a399192e9005705\r\nINFO Request: POST /wd/hub/session/c063102d2b6f37a80a399192e9005705/url \r\n - data:  {\"url\":\"http://www.google.com\"} \r\n - headers:  {\"Content-Type\":\"application/json; charset=utf-8\",\"Content-Length\":31}\r\nINFO Response 200 POST /wd/hub/session/c063102d2b6f37a80a399192e9005705/url (2422ms) { sessionId: 'c063102d2b6f37a80a399192e9005705',\r\n  status: 0,\r\n  value: null }\r\nLOG     → Completed command url (2429 ms)\r\nINFO Request: POST /wd/hub/session/c063102d2b6f37a80a399192e9005705/elements \r\n - data:  {\"using\":\"css selector\",\"value\":\"body\"} \r\n - headers:  {\"Content-Type\":\"application/json; charset=utf-8\",\"Content-Length\":39}\r\nINFO Response 200 POST /wd/hub/session/c063102d2b6f37a80a399192e9005705/elements (35ms) { sessionId: 'c063102d2b6f37a80a399192e9005705',\r\n  status: 0,\r\n  value: [ { ELEMENT: '0.5168266409339404-1' } ] }\r\nINFO Request: GET /wd/hub/session/c063102d2b6f37a80a399192e9005705/element/0.5168266409339404-1/displayed \r\n - data:   \r\n - headers:  {\"Accept\":\"application/json\"}\r\nINFO Response 200 GET /wd/hub/session/c063102d2b6f37a80a399192e9005705/element/0.5168266409339404-1/displayed (19ms) { sessionId: 'c063102d2b6f37a80a399192e9005705',\r\n  status: 0,\r\n  value: true }\r\n ✔ Element <body> was visible after 56 milliseconds.\r\nLOG     → Completed command waitForElementVisible (59 ms)\r\nINFO Request: GET /wd/hub/session/c063102d2b6f37a80a399192e9005705/title \r\n - data:   \r\n - headers:  {\"Accept\":\"application/json\"}\r\nINFO Response 200 GET /wd/hub/session/c063102d2b6f37a80a399192e9005705/title (16ms) { sessionId: 'c063102d2b6f37a80a399192e9005705',\r\n  status: 0,\r\n  value: 'Google' }\r\n ✔ Testing if the page title equals \"Google\".\r\nLOG     → Completed command title (17 ms)\r\nLOG     → Completed command title (16 ms)\r\nINFO Request: POST /wd/hub/session/c063102d2b6f37a80a399192e9005705/element \r\n - data:  {\"using\":\"css selector\",\"value\":\"input[type=text]\"} \r\n - headers:  {\"Content-Type\":\"application/json; charset=utf-8\",\"Content-Length\":51}\r\nINFO Response 200 POST /wd/hub/session/c063102d2b6f37a80a399192e9005705/element (38ms) { sessionId: 'c063102d2b6f37a80a399192e9005705',\r\n  status: 0,\r\n  value: { ELEMENT: '0.5168266409339404-2' } }\r\nINFO Request: GET /wd/hub/session/c063102d2b6f37a80a399192e9005705/element/0.5168266409339404-2/displayed \r\n - data:   \r\n - headers:  {\"Accept\":\"application/json\"}\r\nINFO Response 200 GET /wd/hub/session/c063102d2b6f37a80a399192e9005705/element/0.5168266409339404-2/displayed (34ms) { sessionId: 'c063102d2b6f37a80a399192e9005705',\r\n  status: 0,\r\n  value: true }\r\n ✔ Testing if element <input[type=text]> is visible.\r\nLOG     → Completed command isVisible (76 ms)\r\nINFO Request: POST /wd/hub/session/c063102d2b6f37a80a399192e9005705/element \r\n - data:  {\"using\":\"css selector\",\"value\":\"input[type=text]\"} \r\n - headers:  {\"Content-Type\":\"application/json; charset=utf-8\",\"Content-Length\":51}\r\nINFO Response 200 POST /wd/hub/session/c063102d2b6f37a80a399192e9005705/element (19ms) { sessionId: 'c063102d2b6f37a80a399192e9005705',\r\n  status: 0,\r\n  value: { ELEMENT: '0.5168266409339404-2' } }\r\nINFO Request: POST /wd/hub/session/c063102d2b6f37a80a399192e9005705/element/0.5168266409339404-2/value \r\n - data:  {\"value\":[\"r\",\"e\",\"m\",\"b\",\"r\",\"a\",\"n\",\"d\",\"t\",\" \",\"v\",\"a\",\"n\",\" \",\"r\",\"i\",\"j\",\"n\"]} \r\n - headers:  {\"Content-Type\":\"application/json; charset=utf-8\",\"Content-Length\":83}\r\nINFO Response 200 POST /wd/hub/session/c063102d2b6f37a80a399192e9005705/element/0.5168266409339404-2/value (346ms) { sessionId: 'c063102d2b6f37a80a399192e9005705',\r\n  status: 0,\r\n  value: null }\r\nLOG     → Completed command setValue (366 ms)\r\nINFO Request: POST /wd/hub/session/c063102d2b6f37a80a399192e9005705/elements \r\n - data:  {\"using\":\"css selector\",\"value\":\"button[name=btnG]\"} \r\n - headers:  {\"Content-Type\":\"application/json; charset=utf-8\",\"Content-Length\":52}\r\nINFO Response 200 POST /wd/hub/session/c063102d2b6f37a80a399192e9005705/elements (38ms) { sessionId: 'c063102d2b6f37a80a399192e9005705',\r\n  status: 0,\r\n  value: [] }\r\nINFO Request: POST /wd/hub/session/c063102d2b6f37a80a399192e9005705/elements \r\n - data:  {\"using\":\"css selector\",\"value\":\"button[name=btnG]\"} \r\n - headers:  {\"Content-Type\":\"application/json; charset=utf-8\",\"Content-Length\":52}\r\nINFO Response 200 POST /wd/hub/session/c063102d2b6f37a80a399192e9005705/elements (23ms) { sessionId: 'c063102d2b6f37a80a399192e9005705',\r\n  status: 0,\r\n  value: [] }\r\nINFO Request: POST /wd/hub/session/c063102d2b6f37a80a399192e9005705/elements \r\n - data:  {\"using\":\"css selector\",\"value\":\"button[name=btnG]\"} \r\n - headers:  {\"Content-Type\":\"application/json; charset=utf-8\",\"Content-Length\":52}\r\nINFO Response 200 POST /wd/hub/session/c063102d2b6f37a80a399192e9005705/elements (67ms) { sessionId: 'c063102d2b6f37a80a399192e9005705',\r\n  status: 0,\r\n  value: [] }\r\n ✖ Timed out while waiting for element <button[name=btnG]> to be present for 1000 milliseconds.  - expected \"visible\" but got: \"not found\"\r\n    at Object.Demo test Google (/home/example/Projects/example/tests/NightWatch/google.js:9:8)\r\n    at _combinedTickCallback (internal/process/next_tick.js:131:7)\r\n\r\nLOG     → Completed command waitForElementVisible (1133 ms)\r\nINFO Request: DELETE /wd/hub/session/c063102d2b6f37a80a399192e9005705 \r\n - data:   \r\n - headers:  {\"Content-Length\":0}\r\nINFO Response 200 DELETE /wd/hub/session/c063102d2b6f37a80a399192e9005705 (53ms) { sessionId: 'c063102d2b6f37a80a399192e9005705',\r\n  status: 0,\r\n  value: null }\r\nINFO FINISHED\r\nLOG     → Completed command end (56 ms)\r\nLOG     → Completed command session (56 ms)\r\n\r\nFAILED:  1 assertions failed and 3 passed (5.724s)\r\n\r\n _________________________________________________\r\n\r\n TEST FAILURE:  1 assertions failed, 3 passed. (5.784s)\r\n\r\n ✖ NightWatch/google\r\n\r\n   - Demo test Google (5.724s)\r\n   Timed out while waiting for element <button[name=btnG]> to be present for 1000 milliseconds.  - expected \"visible\" but got: \"not found\"\r\n       at Object.Demo test Google (/home/example/Projects/example/tests/NightWatch/google.js:9:8)\r\n       at _combinedTickCallback (internal/process/next_tick.js:131:7)\r\n```"},"comment":{"url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/comments/441311996","html_url":"https://github.com/nightwatchjs/nightwatch/issues/1933#issuecomment-441311996","issue_url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/1933","id":441311996,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTMxMTk5Ng==","user":{"login":"xurizaemon","id":105608,"node_id":"MDQ6VXNlcjEwNTYwOA==","avatar_url":"https://avatars2.githubusercontent.com/u/105608?v=4","gravatar_id":"","url":"https://api.github.com/users/xurizaemon","html_url":"https://github.com/xurizaemon","followers_url":"https://api.github.com/users/xurizaemon/followers","following_url":"https://api.github.com/users/xurizaemon/following{/other_user}","gists_url":"https://api.github.com/users/xurizaemon/gists{/gist_id}","starred_url":"https://api.github.com/users/xurizaemon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xurizaemon/subscriptions","organizations_url":"https://api.github.com/users/xurizaemon/orgs","repos_url":"https://api.github.com/users/xurizaemon/repos","events_url":"https://api.github.com/users/xurizaemon/events{/privacy}","received_events_url":"https://api.github.com/users/xurizaemon/received_events","type":"User","site_admin":false},"created_at":"2018-11-23T20:09:48Z","updated_at":"2018-11-23T20:09:48Z","author_association":"NONE","body":"I was going to submit a test that tests nightwatchjs.org, but I see there's no form interactivity on the site and think that's a significant part of the demo test.\r\n\r\nFWIW, I found that replacing `btnG` (not on Google AFAICT) with `btnK` (visible on Google if I `.pause()` the test) did *not* resolve the issue. I'm new to Nightwatch, so maybe this is just my setup / config ... or maybe Google's weird :smiling_imp: "}}
{"actor":{"display_login":"xurizaemon"}}