Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Capture Element" keyword on IE11 returns "JavascriptException: Message: Error executing JavaScript" #35

Closed
JoaoEnesGoncalves opened this issue Aug 28, 2019 · 3 comments

Comments

@JoaoEnesGoncalves
Copy link

On Internet Explorerer 11 after call keyword "RobotEyes.Capture Element" was verified error message just with "JavascriptException: Message: Error executing JavaScript"

note: Internet Explorerer 11 webdriver was configured to enable JavaScripting

logs

KEYWORD RobotEyes . Capture Element id=${button_locator}
TRACE	Arguments: [ 'id=default' ]
DEBUG	GET http://127.0.0.1:63787/session/d09d66d5-19a6-49c9-9e91-6df2108259ca/screenshot {}
DEBUG	Starting new HTTP connection (1): 127.0.0.1:63787
DEBUG	http://127.0.0.1:63787 "GET /session/d09d66d5-19a6-49c9-9e91-6df2108259ca/screenshot HTTP/1.1" 200 42393
DEBUG	Finished Request
DEBUG	POST http://127.0.0.1:63787/session/d09d66d5-19a6-49c9-9e91-6df2108259ca/element {"using": "css selector", "value": "[id=\"default\"]"}
DEBUG	Starting new HTTP connection (1): 127.0.0.1:63787
DEBUG	http://127.0.0.1:63787 "POST /session/d09d66d5-19a6-49c9-9e91-6df2108259ca/element HTTP/1.1" 200 102
DEBUG	Finished Request
DEBUG	POST http://127.0.0.1:63787/session/d09d66d5-19a6-49c9-9e91-6df2108259ca/execute/sync {"script": "var e = document.getElementById(\"default\");return e.getBoundingClientRect();", "args": []}
DEBUG	Starting new HTTP connection (1): 127.0.0.1:63787
DEBUG	http://127.0.0.1:63787 "POST /session/d09d66d5-19a6-49c9-9e91-6df2108259ca/execute/sync HTTP/1.1" 500 134
DEBUG	Finished Request
FAIL	JavascriptException: Message: Error executing JavaScript
DEBUG	Traceback (most recent call last):
  File "c:\program files\python37\lib\site-packages\RobotEyes\__init__.py", line 60, in capture_element
    count = self.browser.capture_element(self.path, selector, blur, radius)
  File "c:\program files\python37\lib\site-packages\RobotEyes\selenium_hooks.py", line 28, in capture_element
    coord = self._get_coordinates(prefix, locator)
  File "c:\program files\python37\lib\site-packages\RobotEyes\selenium_hooks.py", line 111, in _get_coordinates
    coord = self.driver.execute_script(cmd)
  File "c:\program files\python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 636, in execute_script
    'args': converted_args})['value']
  File "c:\program files\python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "c:\program files\python37\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
TRACE	Arguments: [ ${button_locator}='default' | ${theme}='default' ]
@jessezach
Copy link
Owner

@JoaoEnesGoncalves Could you confirm that you're not facing this issue when calling the execute javascript directly from a selenium test in robot framework?

@jessezach
Copy link
Owner

Tried fixing this issue in #37
If Javascript error is thrown by selenium, then coordinates will be fetched from the selenium's element object.

@jessezach
Copy link
Owner

Released fix in version 1.1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants