appium: TypeError source.indexof is not a function

Hi I was using appium 1.6.0 , then today I’ve updated my appium to 1.6.3(using the same source code on our side ). But now after application is opened. I saw these error lines writes infinitely after executing this line of code.

String xmlStr = driver.getPageSource();

@#[line:0,col:undefined]
[xmldom error]	element parse error: TypeError: source.indexOf is not a function 

Does anyone know any solution to that?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 32 (15 by maintainers)

Most upvoted comments

Hi,

I’ve come across the same issue re-installing Appium 1.6.4-beta. Or even upgrading to 1.6.4-beta.2

I saw Appium was sending to the device Proxying [POST /wda/element/0/dragfromtoforduration] to [POST http://localhost:8100/session/02B4BCD9-BC91-4B62-864F-CDF015C73524/wda/element/0/dragfromtoforduration] with body: {"fromX":"200","fromY":"600","toX":"200200","toY":"600100","duration":0.002} when Robot Framework keyword was Swipe 200 600 200 100 2 . It seems the last coordinates were concatenated with the origin ones. That’s another issue, but it was what made me re-install 1.6.4-beta.

So, after re-installing, and when the app finished launching (which was working just fine before) started to show these:

[xmldom error]	element parse error: TypeError: source.indexOf is not a function 
@#[line:0,col:undefined]
[xmldom error]	element parse error: TypeError: source.indexOf is not a function 
@#[line:0,col:undefined]
[...]

Here are the Appium logs log_appium_sourceIndexOfIsNotAFunction.log.zip

And the device logs log_device_source.indexOfIsNotAFunction.log.zip

Hope it helps.