{"action":"created","issue":{"url":"https://api.github.com/repos/webdriverio/webdriverio/issues/683","labels_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/683/labels{/name}","comments_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/683/comments","events_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/683/events","html_url":"https://github.com/webdriverio/webdriverio/issues/683","id":98608359,"number":683,"title":"error on Protocol of selectorExecuteAsync or executeAsync","user":{"login":"idoaizenshtein","id":7915227,"avatar_url":"https://avatars.githubusercontent.com/u/7915227?v=3","gravatar_id":"","url":"https://api.github.com/users/idoaizenshtein","html_url":"https://github.com/idoaizenshtein","followers_url":"https://api.github.com/users/idoaizenshtein/followers","following_url":"https://api.github.com/users/idoaizenshtein/following{/other_user}","gists_url":"https://api.github.com/users/idoaizenshtein/gists{/gist_id}","starred_url":"https://api.github.com/users/idoaizenshtein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idoaizenshtein/subscriptions","organizations_url":"https://api.github.com/users/idoaizenshtein/orgs","repos_url":"https://api.github.com/users/idoaizenshtein/repos","events_url":"https://api.github.com/users/idoaizenshtein/events{/privacy}","received_events_url":"https://api.github.com/users/idoaizenshtein/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/webdriverio/webdriverio/labels/Question","name":"Question","color":"006b75"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-02T13:09:25Z","updated_at":"2015-08-22T23:36:10Z","closed_at":"2015-08-21T08:13:08Z","body":"Hello,\r\n\r\nI use webdriver.io and try to incorporate reading ajax after the page is ready ...\r\nI try to use the Protocol of selectorExecuteAsync or executeAsync but whenever I get the following error:\r\n\"webdriverInstance.eventHandler.removeEventListener = removeEventListener (t\r\n                                                        ^\r\nTypeError: Can not set property 'removeEventListener' of undefined\"\r\n\r\nThe code examples are in your documentation:\r\nI also try the code snippet example 3 returned to this page:\r\nhttp://selenium.googlecode.com/git-history/facb1dcca95e8050ab349e5b288ed95377962d37/docs/api/javascript/class_webdriver_WebDriver.html\r\n\r\nAnd you get the same mistake I made before.\r\n```js\r\n  driver.executeAsyncScript (function () {\r\n    var callback = arguments [arguments.length - 1];\r\n    var xhr = new XMLHttpRequest ();\r\n    xhr.open (\"GET\", \"/resource/data.json\", true);\r\n    xhr.onreadystatechange = function () {\r\n      if (xhr.readyState == 4) {\r\n        callback (xhr.resposneText);\r\n      }\r\n    }\r\n    xhr.send ('');\r\n  }). then (function (str) {\r\n    console.log (JSON.parse (str) ['food']);\r\n  });\r\n```\r\nI try the code as it is in the following example:\r\nhttp://webdriver.io/api/protocol/executeAsync.html\r\n\r\n```js\r\nclient\r\n     .timeoutsAsyncScript (5000)\r\n     .executeAsync (function (a, b, c, d, done) {\r\n         setTimeout (function () {\r\n             done (a + b + c + d);\r\n         }, 3000);\r\n     }, 1, 2, 3, 4) .then (function (ret) {\r\n         console.log (ret.value); // Outputs: 10\r\n     });\r\n```\r\nI use a Mac, and ChromeDriver."},"comment":{"url":"https://api.github.com/repos/webdriverio/webdriverio/issues/comments/133764378","html_url":"https://github.com/webdriverio/webdriverio/issues/683#issuecomment-133764378","issue_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/683","id":133764378,"user":{"login":"idoaizenshtein","id":7915227,"avatar_url":"https://avatars.githubusercontent.com/u/7915227?v=3","gravatar_id":"","url":"https://api.github.com/users/idoaizenshtein","html_url":"https://github.com/idoaizenshtein","followers_url":"https://api.github.com/users/idoaizenshtein/followers","following_url":"https://api.github.com/users/idoaizenshtein/following{/other_user}","gists_url":"https://api.github.com/users/idoaizenshtein/gists{/gist_id}","starred_url":"https://api.github.com/users/idoaizenshtein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idoaizenshtein/subscriptions","organizations_url":"https://api.github.com/users/idoaizenshtein/orgs","repos_url":"https://api.github.com/users/idoaizenshtein/repos","events_url":"https://api.github.com/users/idoaizenshtein/events{/privacy}","received_events_url":"https://api.github.com/users/idoaizenshtein/received_events","type":"User","site_admin":false},"created_at":"2015-08-22T23:36:10Z","updated_at":"2015-08-22T23:36:10Z","body":"No ... as I wrote I tried the selenium and the WebdriverIO as I wrote in the second example ...\r\nAnd both of them are not working ..."}}