question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError source.indexof is not a function

See original GitHub issue

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?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
crlsblnccommented, Mar 30, 2017

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.

0reactions
lock[bot]commented, Apr 29, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: .indexOf is not a function - Stack Overflow
2. It is indeed a function - of a valid object - meaning time isn't a valid object. Make sure time exists, log...
Read more >
TypeError: indexOf is not a function in JavaScript | bobbyhadz
The "indexOf is not a function" error occurs when the indexOf() method is called on a value that is not of type string...
Read more >
TypeScript: how to resolve error 'indexOf is not a function'
Sometime on TypeScript, when you call the indexOf() method you can get the error 'indexOf is not a function'. This happens when the...
Read more >
[xmldom error] element parse error: TypeError: source.indexOf ...
The problem I am getting this issue when i tried to run my scripts in a real device, but am able to run...
Read more >
Solved: .indexOf is not a function - Adobe Support Community
In your case, indexOf is a method of a String object while myAlphas is an array. An array object doesn't have a indexOf...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found