{"action":"closed","issue":{"url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/993","repository_url":"https://api.github.com/repos/nightwatchjs/nightwatch","labels_url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/993/labels{/name}","comments_url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/993/comments","events_url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/993/events","html_url":"https://github.com/nightwatchjs/nightwatch/issues/993","id":156702079,"number":993,"title":"Execute and elementIdAttribute conflict with inine script","user":{"login":"iGitScor","id":2276944,"avatar_url":"https://avatars.githubusercontent.com/u/2276944?v=3","gravatar_id":"","url":"https://api.github.com/users/iGitScor","html_url":"https://github.com/iGitScor","followers_url":"https://api.github.com/users/iGitScor/followers","following_url":"https://api.github.com/users/iGitScor/following{/other_user}","gists_url":"https://api.github.com/users/iGitScor/gists{/gist_id}","starred_url":"https://api.github.com/users/iGitScor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iGitScor/subscriptions","organizations_url":"https://api.github.com/users/iGitScor/orgs","repos_url":"https://api.github.com/users/iGitScor/repos","events_url":"https://api.github.com/users/iGitScor/events{/privacy}","received_events_url":"https://api.github.com/users/iGitScor/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-25T09:22:04Z","updated_at":"2016-05-25T11:07:30Z","closed_at":"2016-05-25T11:07:30Z","body":"Hi there,\r\n\r\nI have a mysterious issue using scrollTo and gettingIdAttribute\r\n\r\n```js\r\n'Lazy load images': function execute(browser) {\r\n    var search = this.data.content.search.brand;\r\n    var tempId;\r\n    browser\r\n      .clearValue('form input[type=search]')\r\n      .setValue('form input[type=search]', search)\r\n      .click('form input[type=submit]')\r\n      .waitForElementVisible('body', 1500)\r\n      .element(\r\n        'css selector',\r\n        'ul.block-list img[data-lazy-load]:nth-child(1)',\r\n        function fetchImage(image) {\r\n          tempId = image.ELEMENT;\r\n          browser.elementIdAttribute(image.ELEMENT, 'src', function getSource(source) {\r\n            browser.assert.ok(\r\n              typeof source.value === 'object',\r\n              'Image is a lazy load'\r\n            );\r\n          });\r\n        }\r\n      )\r\n      .execute('scrollTo(0, 10000000)')\r\n      .saveScreenshot('./path/to/ffffffffffffff.png')\r\n      .waitForElementVisible('ul.block-list li:nth-last-of-type(1) img', 1000)\r\n      .elementIdAttribute(tempId, 'src', function getSource(source) {\r\n        console.log(source);\r\n        browser.assert.ok(\r\n          typeof source.value === 'string',\r\n          'Lazy load image is loaded'\r\n        );\r\n      });\r\n```\r\n\r\nsource contains :\r\n```sh\r\n{ status: -1,\r\n  value:\r\n   { message: null,\r\n     suppressed: [],\r\n     localizedMessage: null,\r\n     cause: null,\r\n     class: 'java.lang.NullPointerException',\r\n     hCode: 1771725893,\r\n     screen: null },\r\n  errorStatus: 13,\r\n  error: 'An unknown server-side error occurred while processing the command.' }\r\n```\r\n\r\nIt's strange because the image is well loaded but the `src` couldn't be got.\r\n\r\n_Fact_: green dots symbolize lazy load images (without `src` attribute but with `data-lazy-load` attribute). A script in the website add `src` attribute when the image is visible (like on the screenshot) and remove `data-lazy-load` attribute\r\n\r\n![ffffffffffffff](https://cloud.githubusercontent.com/assets/2276944/15534551/2570955c-221e-11e6-9a4a-76acd1bb0166.png)\r\n\r\nDo you need more information about this issue ?\r\n\r\n-- \r\nGithub: @iGitScor\r\nTwitter: @iTweetScor"}}
{"actor":{"display_login":"beatfactor"}}