find_element_by_xpath using single quotes and an apostrophe hangs instruments - ios simulator

osx 10.10
python
appium 1.3.4
ios 8 sim

The following executes normally:

dr.find_element_by_xpath(“//*[@value=‘my test string’]”)

with the following log:

2015-03-09 16:36:15,574 [DEBUG] selenium.webdriver.remote.remote_connection:POST http://127.0.0.1:4723/wd/hub/session/619d29e3-30b0-4f2d-a648-b4be92de74f6/element {“using”: “xpath”, “sessionId”: “619d29e3-30b0-4f2d-a648-b4be92de74f6”, “value”: “//[@value=‘my test string’]“} [remote_connection.py:363]
2015-03-09 16:36:15,580 [DEBUG] exec_logger.AppiumServer:info: → POST /wd/hub/session/619d29e3-30b0-4f2d-a648-b4be92de74f6/element {“using”:“xpath”,“sessionId”:“619d29e3-30b0-4f2d-a648-b4be92de74f6”,“value”:”//
[@value=‘my test string’]”} [service.py:47]
2015-03-09 16:36:15,580 [DEBUG] exec_logger.AppiumServer:info: [debug] Waiting up to 0ms for condition [service.py:47]
2015-03-09 16:36:15,581 [DEBUG] exec_logger.AppiumServer:info: [debug] Pushing command to appium work queue: “au.mainApp().getTreeForXML()” [service.py:47]
2015-03-09 16:36:15,581 [DEBUG] exec_logger.AppiumServer:info: [debug] Sending command to instruments: au.mainApp().getTreeForXML() [service.py:47]
2015-03-09 16:36:15,725 [DEBUG] exec_logger.AppiumServer:info: [debug] [INST] 2015-03-09 21:36:15 +0000 Debug: Got new command 5 from instruments: au.mainApp().getTreeForXML() [service.py:47]
2015-03-09 16:36:15,727 [DEBUG] exec_logger.AppiumServer:info: [debug] [INST] 2015-03-09 21:36:15 +0000 Debug: evaluating au.mainApp().getTreeForXML() [service.py:47]
2015-03-09 16:36:15,729 [DEBUG] exec_logger.AppiumServer:info: [debug] [INST] 2015-03-09 21:36:15 +0000 Debug: evaluation finished [service.py:47]
2015-03-09 16:36:15,735 [DEBUG] exec_logger.AppiumServer:info: [debug] [INST] 2015-03-09 21:36:15 +0000 Debug: responding with::true,“visible”:true,“hint”:null,“path”:“/0/0”,“x”:0,“y”:0,“width”:320,“height”:568},“>”:[{“UIAElement”:{“@”:{“name”:“login_title_image”,“label”:null,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:“/0/0/0”,“x”:0,“y”:0,“width”:320,“height”:568},“>”:[{“UIAImage”:{“@”:{“name”:“login_title_image”,“label”:null,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:“/0/0/0/0”,“x”:103,“y”:10,“width”:114,“height”:155.5},“>”:}},{“UIAStaticText”:{“@”:{“name”:“login_error_text”,“label”:null,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:false,“hint”:null,“path”:“/0/0/0/1”,“x”:20,“y”:165.5,“width”:280,“height”:0},“>”:}},{“UIATextField”:{“@”:{“name”:“login_username_textfield”,“label”:“”,“value”:“Email Address”,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:“/0/0/0/2”,“x”:60,“y”:180.5,“width”:200,“height”:36},“>”:[{“UIATextFie [service.py:47]
2015-03-09 16:36:15,736 [DEBUG] exec_logger.AppiumServer:info: [debug] [INST] 2015-03-09 21:36:15 +0000 Debug: Running system command #6: /Users/qwe/Documents/mats/.buildout/parts/buildout-node/node-v0.10.24-darwin-x64/bin/node /Users/qwe/Documents/mats/.buildout/parts/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{“status”:0,“value”:{“UIAApplication”:{”@“:{“name”:“my_app”,“labe… [service.py:47]
2015-03-09 16:36:15,745 [DEBUG] exec_logger.AppiumServer:info: [debug] Socket data received (5097 bytes) [service.py:47]
2015-03-09 16:36:15,745 [DEBUG] exec_logger.AppiumServer:info: [debug] Socket data being routed. [service.py:47]
2015-03-09 16:36:15,746 [DEBUG] exec_logger.AppiumServer:info: [debug] Got result from instruments: {“status”:0,“value”:{“UIAApplication”:{”@”:{“name”:“my_app”,“label”:“my_app”,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:“/0”,“x”:0,“y”:20,“width”:320,“height”:548},“>”:[{“UIAWindow”:{“@”:{“name”:null,“label”:null,“value”:null,“dom”:null,“enabled”:true,“valid” [service.py:47]
2015-03-09 16:36:15,753 [DEBUG] exec_logger.AppiumServer:info: [debug] Condition unmet after 172ms. Timing out. [service.py:47]
2015-03-09 16:36:15,753 [DEBUG] exec_logger.AppiumServer:info: [debug] Responding to client with error: {“status”:7,“value”:{“message”:“An element could not be located on the page using the given search parameters.”},“sessionId”:“619d29e3-30b0-4f2d-a648-b4be92de74f6”} [service.py:47]
2015-03-09 16:36:15,754 [DEBUG] selenium.webdriver.remote.remote_connection:Finished Request [remote_connection.py:458]
2015-03-09 16:36:15,755 [DEBUG] exec_logger.AppiumServer:info: ← POST /wd/hub/session/619d29e3-30b0-4f2d-a648-b4be92de74f6/element 500 174.363 ms - 164 [service.py:47]

but the following

dr.find_element_by_xpath(“//*[@value=‘my test 'string’]”)

hangs at the last line here:

2015-03-09 16:36:21,911 [DEBUG] selenium.webdriver.remote.remote_connection:POST http://127.0.0.1:4723/wd/hub/session/619d29e3-30b0-4f2d-a648-b4be92de74f6/element {“using”: “xpath”, “sessionId”: “619d29e3-30b0-4f2d-a648-b4be92de74f6”, “value”: “//[@value='my test ‘string’]“} [remote_connection.py:363]
2015-03-09 16:36:21,917 [DEBUG] exec_logger.AppiumServer:info: → POST /wd/hub/session/619d29e3-30b0-4f2d-a648-b4be92de74f6/element {“using”:“xpath”,“sessionId”:“619d29e3-30b0-4f2d-a648-b4be92de74f6”,“value”:”//
[@value='my test ‘string’]”} [service.py:47]
2015-03-09 16:36:21,919 [DEBUG] exec_logger.AppiumServer:info: [debug] Waiting up to 0ms for condition [service.py:47]
2015-03-09 16:36:21,919 [DEBUG] exec_logger.AppiumServer:info: [debug] Pushing command to appium work queue: “au.mainApp().getTreeForXML()” [service.py:47]
2015-03-09 16:36:21,920 [DEBUG] exec_logger.AppiumServer:info: [debug] Sending command to instruments: au.mainApp().getTreeForXML() [service.py:47]
2015-03-09 16:36:22,043 [DEBUG] exec_logger.AppiumServer:info: [debug] [INST] 2015-03-09 21:36:21 +0000 Debug: Got new command 6 from instruments: au.mainApp().getTreeForXML() [service.py:47]
2015-03-09 16:36:22,045 [DEBUG] exec_logger.AppiumServer:info: [debug] [INST] 2015-03-09 21:36:21 +0000 Debug: evaluating au.mainApp().getTreeForXML() [service.py:47]
2015-03-09 16:36:22,048 [DEBUG] exec_logger.AppiumServer:info: [debug] [INST] 2015-03-09 21:36:21 +0000 Debug: evaluation finished [service.py:47]
2015-03-09 16:36:22,055 [DEBUG] exec_logger.AppiumServer:info: [debug] [INST] 2015-03-09 21:36:21 +0000 Debug: responding with::true,“visible”:true,“hint”:null,“path”:“/0/0”,“x”:0,“y”:0,“width”:320,“height”:568},“>”:[{“UIAElement”:{“@”:{“name”:“login_title_image”,“label”:null,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:“/0/0/0”,“x”:0,“y”:0,“width”:320,“height”:568},“>”:[{“UIAImage”:{“@”:{“name”:“login_title_image”,“label”:null,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:“/0/0/0/0”,“x”:103,“y”:10,“width”:114,“height”:155.5},“>”:}},{“UIAStaticText”:{“@”:{“name”:“login_error_text”,“label”:null,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:false,“hint”:null,“path”:“/0/0/0/1”,“x”:20,“y”:165.5,“width”:280,“height”:0},“>”:}},{“UIATextField”:{“@”:{“name”:“login_username_textfield”,“label”:“”,“value”:“Email Address”,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:“/0/0/0/2”,“x”:60,“y”:180.5,“width”:200,“height”:36},“>”:[{“UIATextFie [service.py:47]
2015-03-09 16:36:22,055 [DEBUG] exec_logger.AppiumServer:info: [debug] [INST] 2015-03-09 21:36:21 +0000 Debug: Running system command #7: /Users/qwe/Documents/mats/.buildout/parts/buildout-node/node-v0.10.24-darwin-x64/bin/node /Users/qwe/Documents/mats/.buildout/parts/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{“status”:0,“value”:{“UIAApplication”:{”@“:{“name”:“my_app”,“labe… [service.py:47]
2015-03-09 16:36:22,088 [DEBUG] exec_logger.AppiumServer:info: [debug] Socket data received (5097 bytes) [service.py:47]
2015-03-09 16:36:22,089 [DEBUG] exec_logger.AppiumServer:info: [debug] Socket data being routed. [service.py:47]
2015-03-09 16:36:22,090 [DEBUG] exec_logger.AppiumServer:info: [debug] Got result from instruments: {“status”:0,“value”:{“UIAApplication”:{”@”:{“name”:“my_app”,“label”:“my_app”,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:“/0”,“x”:0,“y”:20,“width”:320,“height”:548},“>”:[{“UIAWindow”:{“@”:{“name”:null,“label”:null,“value”:null,“dom”:null,“enabled”:true,“valid” [service.py:47]
2015-03-09 16:37:24,449 [DEBUG] service.Process:Exited (130) [service.py:250]
2015-03-09 16:37:25,453 [DEBUG] exec_logger.AppiumServer:Process exited with 130 [service.py:47]

workaround:

dr.find_element_by_xpath(“//*[@value="my test 'string"]”)