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

alert is not defined #1

Open
grosser opened this issue Mar 25, 2010 · 4 comments
Open

alert is not defined #1

grosser opened this issue Mar 25, 2010 · 4 comments

Comments

@grosser
Copy link

grosser commented Mar 25, 2010

just tried to use it, but only got
xpath failure: ReferenceError: alert is not defined
WARNIING: [Thu Mar 25 2010 15:19:48 GMT+0100 (CET)] {ENVJS} could not load script http://example.com/javascripts/scriptaculous.js?1269513576: alert is not defined
ERROR: [Thu Mar 25 2010 15:19:49 GMT+0100 (CET)] {ENVJS} error evaluating script:

@smparkes
Copy link
Owner

This is actually an env-js issue (which I also support). Looks like our xpath engine doesn't have everything that prototype wants. We are looking at another engine or might be able to implement the pieces missing ... but I'm not sure when.

The workaound for now is disable xpath before loading prototype with something like

if (this.Envjs) { window.evaluate = undefined; }

@smparkes
Copy link
Owner

Oh, and by the way, the "alert" not defined is a bug that I'll check in a fix soon, but it was just hiding the real issue.

@smparkes
Copy link
Owner

Actually, the capybara driver needs access to xpath, so I'm pretty sure you'll need to save the reference and restore it, something like

var saved_evaluate = window.evaluate;
if (this.Envjs) { window.evaluate = undefined; }
include prototype
if (this.Envjs) { window.evaluate = saved_evaluate; }

Kind of a pain ... sorry 'bout that. xpath is ... painful. Can't really fault prototype for trying to figure out if the xpath it has access to is working.

@Papipo
Copy link

Papipo commented Jul 10, 2010

I used this same fix to handle google dfp ads. loading the main script broke my tests.

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

3 participants