WebDriverException: Message: unknown error: Cannot read property 'get' of undefined

566 views
Skip to first unread message

Lisa

unread,
Mar 1, 2019, 12:57:49 AM3/1/19
to robotframework-users
Hello,

Thank you in advance for your help!

I am using robotframework-seleniumlibrary 3.3.1 and robotframework-angularjs 0.0.9

With this code:
Library  SeleniumLibrary
Library  AngularJSLibrary

go to  ${URL}  #this is an angular site
wait for angular

I am getting:

WebDriverException: Message: unknown error: Cannot read property 'get' of undefined
  (Session info: headless chrome=72.0.3626.119)
  (Driver info: chromedriver=72.0.3626.69 (3c16f8a135abc0d4da2dff33804db79b849a7c38),platform=Windows NT 10.0.17134 x86_64)

Here is the trace information:
KEYWORD AngularJSLibrary . Wait For Angular
Start / End / Elapsed: 20190228 19:29:18.938 / 20190228 19:29:18.965 / 00:00:00.027
19:29:18.938 TRACE Arguments: [  ]
19:29:18.939 DEBUG POST http://127.0.0.1:65348/session/aabc7807fd97105c5c919e6f57c26dfb/execute {"script": "\n    var waiting = true;\n    var callback = function () {waiting = false;}\n    var el = document.querySelector(arguments[0]);\n    if (window.angular && !(window.angular.version &&\n          window.angular.version.major > 1)) {\n      /* ng1 */\n      angular.element(el).injector().get('$browser').\n          notifyWhenNoOutstandingRequests(callback);\n    } else if (window.getAngularTestability) {\n      return !window.getAngularTestability(el).isStable(callback);\n    } else if (window.getAllAngularTestabilities) {\n      throw new Error('AngularJSLibrary does not currently handle ' +\n          'window.getAllAngularTestabilities. It does work on sites supporting ' +\n          'window.getAngularTestability. If you require this functionality, please ' +\n          'the library authors or reach out to the Robot Framework Users Group.');\n    } else if (!window.angular) {\n      throw new Error('window.angular is undefined.  This could be either ' +\n          'because this is a non-angular page or because your test involves ' +\n          'client-side navigation. Currently the AngularJS Library is not ' +\n          'designed to wait in such situations. Instead you should explicitly ' +\n          'call the \"Wait For Angular\" keyword.');\n    } else if (window.angular.version >= 2) {\n      throw new Error('You appear to be using angular, but window.' +\n          'getAngularTestability was never set.  This may be due to bad ' +\n          'obfuscation.');\n    } else {\n      throw new Error('Cannot get testability API for unknown angular ' +\n          'version \"' + window.angular.version + '\"');\n    }\n    return waiting;\n", "args": ["[ng-app]"], "sessionId": "aabc7807fd97105c5c919e6f57c26dfb"}
19:29:18.957 DEBUG http://127.0.0.1:65348 "POST /session/aabc7807fd97105c5c919e6f57c26dfb/execute HTTP/1.1" 200 311
19:29:18.957 DEBUG Finished Request
19:29:18.964 FAIL WebDriverException: Message: unknown error: Cannot read property 'get' of undefined
  (Session info: headless chrome=72.0.3626.119)
  (Driver info: chromedriver=72.0.3626.69 (3c16f8a135abc0d4da2dff33804db79b849a7c38),platform=Windows NT 10.0.17134 x86_64)
19:29:18.965 DEBUG Traceback (most recent call last):
  File "c:\users\lgutr\appdata\local\programs\python\python36\lib\site-packages\AngularJSLibrary\__init__.py", line 206, in wait_for_angular
    .until_not(lambda x: self._s2l._current_browser().execute_script(js_wait_for_angular, self.root_selector))
  File "c:\users\lgutr\appdata\local\programs\python\python36\lib\site-packages\selenium\webdriver\support\wait.py", line 88, in until_not
    value = method(self._driver)
  File "c:\users\lgutr\appdata\local\programs\python\python36\lib\site-packages\AngularJSLibrary\__init__.py", line 206, in <lambda>
    .until_not(lambda x: self._s2l._current_browser().execute_script(js_wait_for_angular, self.root_selector))
  File "c:\users\lgutr\appdata\local\programs\python\python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 636, in execute_script
    'args': converted_args})['value']
  File "c:\users\lgutr\appdata\local\programs\python\python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "c:\users\lgutr\appdata\local\programs\python\python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)


Lisa

Omer Nir

unread,
Mar 3, 2019, 8:33:45 AM3/3/19
to robotframework-users
also didn't make it work on my framework, used 'wait...' keywords in selenium lib and sleep (unfortunately...)

Lisa

unread,
Mar 5, 2019, 9:34:39 AM3/5/19
to robotframework-users
Hello again?

Is there any help for me?

If I try to go to Selenium2Library and the Extended.... library will I get the same issue?

Thank you!

Omer Nir

unread,
Mar 5, 2019, 12:55:22 PM3/5/19
to robotframework-users
I tried with selenium2library too with no luck.

try to contact the developer

Iulius Caesar

unread,
Mar 5, 2019, 1:02:38 PM3/5/19
to omni...@gmail.com, robotframework-users

Hello Omer,

 

The history of Selenium Library and the naming schema is rather complicated for as much as I understand. Check this link, it might help clear some out:

https://github.com/robotframework/SeleniumLibrary

 

I hope this helps

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

 

Alejandro cruz jimenez

unread,
Mar 5, 2019, 5:39:19 PM3/5/19
to robotframework-users
Hello Lisa,


I had the same issue, I noticed the root_selector always search for the element containing '[ng-app]' by default. Unlucky for me, the root element of my application had the attribute '[data-ng-app]' and not '[ng-app]'.
I solved my problem by indicating the root selector to the Settings: 


Library  SeleniumLibrary
Library  AngularJSLibrary    root_selector=[data-ng-app]

I hope this helps you!

Tatu Aalto

unread,
Mar 6, 2019, 2:22:10 AM3/6/19
to alexc...@gmail.com, robotframework-users
Ugh

Did you raise an issue to the AngularJSLibrary issue tracker? If you didn't, could you and explain also how you did fix it.

-Tatu
Send from my mobile


--

Lisa

unread,
Mar 18, 2019, 7:40:25 PM3/18/19
to robotframework-users
Hi Alejandro,
Thank you for trying!  This did not solve the issue for me but it did get me closer.  

Hi Tatu,
The page I am accessing here is the login page, which is NOT angular.  I noticed in protractor blogs that they also have this issue when the login page is not angular.  They have a special driver command to avoid angular until after logged in, then change the driver command again:


Has anyone else faced this in robotframework and how to get around it?

Thanks
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.

Tatu Aalto

unread,
Mar 19, 2019, 3:18:01 AM3/19/19
to lgu...@juno.com, robotframework-users
Ugh

By looking at the code, there is a set_ignore_implicit_angular_wait keyword, which should disable or enable the Angular waiting. Note that argument must be Python True or False. In Robot Framework it means ${True} or ${False}, case insensitive.

Unfortunately for users, there is not a keyword documentation in the keyword and therefore users don't know, without reading the code what that keyword actually does. If you feel that this is important for you, please raise an issue and even better if the issue can be backed up pull request to fix it.


-Tatu
Send from my mobile
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.

To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages