I need to check that element doesn’t exist. I am getting this error in the same step. But that doesn’t happen always.
info: [debug] Proxied response received with status 500:
error: Unexpected error: TypeError: invalid media type
at splitType (/Users/kirill/appium/node_modules/express/node_modules/media-typer/index.js:240:11)
at Object.parse (/Users/kirill/appium/node_modules/express/node_modules/media-typer/index.js:160:13)
at exports.setCharset (/Users/kirill/appium/node_modules/express/lib/utils.js:247:22)
at ServerResponse.res.send (/Users/kirill/appium/node_modules/express/lib/response.js:133:32)
at /Users/kirill/appium/lib/server/proxy.js:80:11
at safely (/Users/kirill/appium/lib/server/helpers.js:306:5)
at /Users/kirill/appium/lib/server/proxy.js:77:5
at Request._callback (/Users/kirill/appium/lib/devices/common.js:121:5)
at Request.self.callback (/Users/kirill/appium/node_modules/request/request.js:121:22)
at Request.emit (events.js:98:17) context: [GET /wd/hub/session/9b145647-42f8-6ee0-38eb-252fd06c6dff/element/:wdc:1414453640513/displayed {}]
Yeah, I just waiting for element getting it by text using xpath and I get this error:
info: [debug] Proxying command to localhost:8080
info: [debug] Making http request with opts: {"url":"http://localhost:8080/wd/hub/session/7579d069-1709-e313-eb0c-9fe6150ea7b3/element","method":"POST","json":{"using":"xpath","value":"//*[contains(text(), 'text')]"}}
info: [debug] Proxied response received with status 200: {"value":{"ELEMENT":":wdc:1415226603727"},"status":0,"sessionId":"7579d069-1709-e313-eb0c-9fe6150ea7b3"}
info: <-- POST /wd/hub/session/7579d069-1709-e313-eb0c-9fe6150ea7b3/element 200 198.129 ms - 104
info: --> GET /wd/hub/session/7579d069-1709-e313-eb0c-9fe6150ea7b3/element/:wdc:1415226603727/displayed {}
info: [debug] Proxying command to localhost:8080
info: [debug] Making http request with opts: {"url":"http://localhost:8080/wd/hub/session/7579d069-1709-e313-eb0c-9fe6150ea7b3/element/:wdc:1415226603727/displayed","method":"GET"}
info: [debug] Proxied response received with status 500:
error: Unexpected error: TypeError: invalid media type
at splitType (/Users/kirill/appium/node_modules/express/node_modules/media-typer/index.js:240:11)
at Object.parse (/Users/kirill/appium/node_modules/express/node_modules/media-typer/index.js:160:13)
at exports.setCharset (/Users/kirill/appium/node_modules/express/lib/utils.js:247:22)
at ServerResponse.res.send (/Users/kirill/appium/node_modules/express/lib/response.js:133:32)
at /Users/kirill/appium/lib/server/proxy.js:80:11
at safely (/Users/kirill/appium/lib/server/helpers.js:306:5)
at /Users/kirill/appium/lib/server/proxy.js:77:5
at Request._callback (/Users/kirill/appium/lib/devices/common.js:121:5)
at Request.self.callback (/Users/kirill/appium/node_modules/request/request.js:121:22)
at Request.emit (events.js:98:17) context: [GET /wd/hub/session/7579d069-1709-e313-eb0c-9fe6150ea7b3/element/:wdc:1415226603727/displayed {}]
Odd thing is that it is happening only in one spot with specific element in entire app.