Does anyone know why Click Element produces "TypeError: string indices must be integers" in my headless setup and runs well in my other setup with RIDE?

467 views
Skip to first unread message

mell...@prometsource.com

unread,
Feb 4, 2016, 4:03:34 PM2/4/16
to robotframework-users
Does anyone know why does my locator '//div[@class='addressfield-container-inline locality-block country-US']/div[2]/div/button/span' run on my robotframework with ride setup and not on my headless setup because it produces an error TypeError: string indices must be integers.

Debug log:
04:00:53.153INFOClicking element '//div[@class='addressfield-container-inline locality-block country-US']/div[2]/div/button/span'.
04:00:53.154DEBUGPOST http://127.0.0.1:46547/hub/session/bde92444-7cd4-401c-921d-e3a1b5f18336/elements {"using": "xpath", "sessionId": "bde92444-7cd4-401c-921d-e3a1b5f18336", "value": "//div[@class='addressfield-container-inline locality-block country-US']/div[2]/div/button/span"}
04:00:53.246DEBUGFinished Request
04:00:53.248DEBUGPOST http://127.0.0.1:46547/hub/session/bde92444-7cd4-401c-921d-e3a1b5f18336/element/{63a70709-8306-48f5-a744-576d9239bf49}/click {"sessionId": "bde92444-7cd4-401c-921d-e3a1b5f18336", "id": "{63a70709-8306-48f5-a744-576d9239bf49}"}
04:00:53.415DEBUGFinished Request
04:00:53.828FAILTypeError: string indices must be integers
04:00:53.828DEBUGTraceback (most recent call last): File "<decorator-gen-46>", line 2, in click_element File "/usr/local/lib/python2.7/dist-packages/Selenium2Library/keywords/keywordgroup.py", line 15, in _run_on_failure_decorator return method(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/Selenium2Library/keywords/_element.py", line 344, in click_element self._element_find(locator, True, True).click() File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webelement.py", line 75, in click self._execute(Command.CLICK_ELEMENT) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webelement.py", line 460, in _execute return self._parent.execute(command, params) File "/usr/local/lib/python2.7/dist-packages/Selenium2Library/webdrivermonkeypatches.py", line 11, in execute result = self._base_execute(driver_command, params) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 201, in execute self.error_handler.check_response(response) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 107, in check_response message = value["value"]["message"]

dm08

unread,
Feb 4, 2016, 4:06:16 PM2/4/16
to mell...@prometsource.com, robotframework-users
I think this is related to https://github.com/SeleniumHQ/selenium/pull/1547
Try to use another version f.e. 2.47.3

Thanks,
Dmitry


--
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.

Mellomar Otarra

unread,
Feb 4, 2016, 7:43:24 PM2/4/16
to dm08, robotframework-users
Hi Dmitry,

Thank you for your fast response.
I have tried to apply those change and it seems that it didn't solve the issue.

Thanks,
Mello

Zeevik Neuman

unread,
Feb 11, 2016, 2:12:52 PM2/11/16
to robotframework-users
Had a similar issue with clicking a button (getting TypeError: string indices must be integers with the same trace)
Discovered that while everything works great manually, when running the test with Firefox, the button I'm trying to click was clickable ONLY on the left part of it (again, fully clickable while manually testing).
Used Click Element At Coordinates, shifting the click to the left solved the issue for me

Hope that helps,
Zeevik

dm08

unread,
Feb 11, 2016, 2:27:30 PM2/11/16
to zee...@zeevik.net, robotframework-users
Reply all
Reply to author
Forward
0 new messages