Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: "all[i].className.split is not a function" #358

Closed
knocte opened this issue Mar 31, 2017 · 2 comments
Closed

Error: "all[i].className.split is not a function" #358

knocte opened this issue Mar 31, 2017 · 2 comments

Comments

@knocte
Copy link
Contributor

knocte commented Mar 31, 2017

We got today an interesting error, which seems not deterministic (if we run it again, it goes away):

Check Success Notification for Step 1
Error: 
unknown error: all[i].className.split is not a function
  (Session info: chrome=56.0.2924.76)
  (Driver info: chromedriver=2.25,platform=Linux 4.9.9-coreos-r1 x86_64)
Url: https://**redacted**/platform/getStarted
Stack: 
  at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError (OpenQA.Selenium.Remote.Response errorResponse) <0x40e41000 + 0x00243> in <filename unknown>:0 
  at OpenQA.Selenium.Remote.RemoteWebDriver.Execute (System.String driverCommandToExecute, System.Collections.Generic.Dictionary`2 parameters) <0x40dd1160 + 0x0017f> in <filename unknown>:0 
  at OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteScriptCommand (System.String script, System.String commandName, System.Object[] args) <0x40e3b680 + 0x00106> in <filename unknown>:0 
  at OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteScript (System.String script, System.Object[] args) <0x40e3b640 + 0x0002f> in <filename unknown>:0 
  at canopy.core.suggestOtherSelectors$cont@181 (System.String cssSelector, Microsoft.FSharp.Core.Unit unitVar) <0x40e7f000 + 0x0010c> in <filename unknown>:0 
  at canopy.core.findByFunction[a,b,c] (System.String cssSelector, canopy.a timeout, Microsoft.FSharp.Core.FSharpFunc`2 waitFunc, canopy.b searchContext, Boolean reliable) <0x40e3d570 + 0x00273> in <filename unknown>:0 
  at canopy.core.elementWithin (System.String cssSelector, IWebElement elem) <0x40e51150 + 0x000ef> in <filename unknown>:0 
  at UITest.GateCoinCommon.CheckSuccessNotification (System.String name, System.String message) [0x00036] in /builds/gatecoin/web-ui-tests/UITest/GateCoinCommon.fs:95 
  at [email protected] (Microsoft.FSharp.Core.Unit _arg4) [0x00027] in /builds/gatecoin/web-ui-tests/UITest/SignUpGetStarted.fs:129 
  at [email protected] (Microsoft.FSharp.Core.Unit x) <0x40e4a460 + 0x0003b> in <filename unknown>:0 
  at canopy.runner.tryTest[a,b] (canopy.a test, canopy.b suite, Microsoft.FSharp.Core.FSharpFunc`2 func) <0x40e4a250 + 0x00043> in <filename unknown>:0 

Any idea how this could happen?

@lefthandedgoat
Copy link
Owner

Its this line right here: https://github.com/lefthandedgoat/canopy/blob/master/src/canopy/canopy.fs#L155

When it can't find a selector it grabs all the elements in the doms, their classes/ids etc, and tries to suggest one for you that is similar. Maybe I need to do .toString().

This is old code so its unfortunate its breaking now, but who knows with JS.

I will update and do it a new build tonight.

@lefthandedgoat
Copy link
Owner

I could not reproduce this in the js console window, because className is a string, so I am unsure how split is there sometimes and not others.

I did add a 'toString()' call before the split to always coerce className to a string. I hope this fixes it.

You can download the updated package here: https://www.nuget.org/packages/canopy/1.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants