Skip to content
This repository was archived by the owner on Nov 29, 2018. It is now read-only.

InternetExplorerDriver execute_script raise ValueError "Unknown result type" #641

Closed
lukeis opened this issue Mar 2, 2016 · 9 comments
Closed

Comments

@lukeis
Copy link
Member

lukeis commented Mar 2, 2016

Originally reported on Google Code with ID 641

What steps will reproduce the problem?
Python 2.6 + selenium python bindings
>>> from selenium.ie.webdriver import WebDriver
>>> driver=WebDriver()
>>> driver.get("http://www.google.com")
>>> driver.execute_script("alert('test');return 1")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "d:\dev\Python26\lib\site-packages\selenium-2.0_dev_9310-py2.6.egg\seleni
um\ie\webdriver.py", line 439, in execute_script
    value = self._parse_script_result(result)
  File "d:\dev\Python26\lib\site-packages\selenium-2.0_dev_9310-py2.6.egg\seleni
um\ie\webdriver.py", line 424, in _parse_script_result
    raise ValueError("Unknown result type - %d" % restype)
ValueError: Unknown result type - 0

What is the expected output? What do you see instead?
After running this snippet, IE should alert and return value 1. It does alert, but
with no return value, some error occurred.

What version of the product are you using? On what operating system?
Selenium r9310
win7+IE8

Please provide any additional information below.
It seems that there are some bugs within the InternetExplorerDriver cpp module or associated
python module.

Reported by jackyspy on 2010-07-13 01:34:41

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

The IE bindings are not functional yet (missing the DLLs). Will try to have it fixed
soon.

Reported by miki.tebeka on 2010-07-13 14:50:45

  • Labels added: Lang-Python

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

I've copied jobbie\prebuilt\Win32\Release\InternetExplorerDriver.dll to Python26\Lib\site-packages\selenium-2.0_dev_9310-py2.6.egg\selenium\ie\,
and most of the functions can work properly. So, I mean, It is not missing the DLLs
which cause this error.

Reported by jackyspy on 2010-07-14 00:10:17

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Ah, OK. I'll have a look

Reported by miki.tebeka on 2010-07-14 17:52:53

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Guys, I have solved the problem. In the _parse_script_result method (webdriver.py) there
is the _call("wdGetScriptResultType", ptr, ctypes.byref(restype)) call. Here is a bug,
it is necessary to use self. I mean self._call("wdGetScriptResultType", ptr, ctypes.byref(restype)).
I hope you will fix it. Best regards!

Reported by andrey.malkov on 2010-11-18 16:36:46

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

yes, it does work.

Reported by jackyspy on 2010-11-19 03:02:03

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Is this issue fixed in trunk?

Reported by simon.m.stewart on 2011-01-21 14:42:48

  • Labels added: bro, Component-WebDriver

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Reported by jari.bakken on 2011-01-27 01:19:56

  • Labels added: Browser-IE
  • Labels removed: bro

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

I have rewritten the Python IEdriver in r11134 and added tests for this. Now fixed

Reported by theautomatedtester on 2011-01-27 10:26:25

  • Status changed: Fixed

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Reported by luke.semerau on 2015-09-17 17:49:40

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 2, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant