javascript - Ghostdriver 1.2.1 + PhantomJS 2.0 + latest Selenium Can't find variable error in Java -


[error - 2016-01-16t02:22:00.898z] session [e6651a90-bbf7-11e5-9061-cff578894101] - page.onerror - msg: referenceerror: can't find variable: data    :262 in error [error - 2016-01-16t02:22:00.898z] session [e6651a90-bbf7-11e5-9061-cff578894101] - page.onerror - stack:   (anonymous function) (http://www.example.com/ns/common/jquery/jquery.cartactions.js?cd=0:205)   o (http://www.example.com/images/common/jquery/jquery.latest.js:2)   firewith (http://www.example.com/images/common/jquery/jquery.latest.js:2)   w (http://www.example.com/images/common/jquery/jquery.latest.js:4)   d (http://www.example.com/images/common/jquery/jquery.latest.js:4)   openurl (:0)   open (:280)   (anonymous function) (:/ghostdriver/request_handlers/session_request_handler.js:495)   _execfuncandwaitforloaddecorator (:/ghostdriver/session.js:212)   _posturlcommand (:/ghostdriver/request_handlers/session_request_handler.js:494)   _handle (:/ghostdriver/request_handlers/session_request_handler.js:91)   _reroute (:/ghostdriver/request_handlers/request_handler.js:61)   _handle (:/ghostdriver/request_handlers/router_request_handler.js:78)    :262 in error 

^domain edited out on purpose.

according can't find variable - phantomjs error has not having proper jailed execution of javascript. don't understand means in context of java program.

my selenium program has 1 kind of javascript call, , works this:

((javascriptexecutor) driver).executescript("arguments[0].click();", buttontoclick); 

the line above doesn't seem issue because tests can see multiple lines above execute without error before coming above error.

also, session.negotiatedcapabilities has "acceptsslcerts":false, have not been able solve code block phantomjs driver initializer:

string[] cli_args = new string[]{"--debug=false", "--web-security=false", "--ssl-protocol=any", "--ignore-ssl-errors=true"};         desiredcapabilities caps = desiredcapabilities.phantomjs();         caps.setcapability(phantomjsdriverservice.phantomjs_cli_args, cli_args);         caps.setcapability(phantomjsdriverservice.phantomjs_executable_path_property, "/users/richard/downloads/phantomjs-2.0.0-macosx/bin/phantomjs");         driver = new phantomjsdriver(caps); 

i can see arguments being passed in on console...

jan 16, 2016 6:23:40 org.openqa.selenium.phantomjs.phantomjsdriverservice <init> info: arguments: [--web-security=no, --ignore-ssl-errors=yes, --webdriver=33238, --webdriver-logfile=/users/richard/yeezybot/phantomjsdriver.log] 

finally, works firefox webdriver.


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -