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

arguments undefined in executeScript() #196

Closed
omeraslam-vteams opened this issue Jan 19, 2015 · 6 comments
Closed

arguments undefined in executeScript() #196

omeraslam-vteams opened this issue Jan 19, 2015 · 6 comments

Comments

@omeraslam-vteams
Copy link

dont know if others are also having this problem but i am getting undefined for the arguments
see below code
echo $myBrowserDriver->executeScript('return alert(arguments[0])',array('john','don'));
please look into it
regards,
Omer Aslam

@omeraslam-vteams
Copy link
Author

anybody tried it so far ? i am still getting the same undefined result
regards,
Omer Aslam

@gabrielpreston
Copy link
Contributor

Looking at this very briefly, it looks like the arguments need to be provided in a key=>value pairing. Take a look at the prepareScriptArguments() function at line 234 of lib/remote/RemoteWebDriver.php. Someone else may be able to speak more to this.

@whhone
Copy link
Contributor

whhone commented Jan 20, 2015

@omeraslam-vteams

echo $myBrowserDriver->executeScript('return alert(arguments[0])',array('john','don')); looks good and it works on OSX/firefox.

What is the platform/browser you were using?

@omeraslam-vteams
Copy link
Author

@whhone well i am using with the following environment

OS
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty

Browser
Firefox version 35.0

Selenium Server 2.44.0

and this simple line is giving me the undefined in alert it was working before Last Thursday 15th Jan after i updated my copy via composer.dont know what happened my working tests started to fail.

@gabrielpreston no it's just checking if the instance of webdriver is passed via arguments array to the method in the value then gets the ID for that element else checks if it is an array() then call the method again passing the value as a parameter and if not then saves the value in the $args array()
regards,
Omer Aslam

@omeraslam-vteams
Copy link
Author

No response from anyone yet on this issue

@gfosco
Copy link
Contributor

gfosco commented May 12, 2015

Closing this as it doesn't appear to be widespread, and does not have a clear reproduction. Since it was working for you and then stopped, and is working for others, I lean towards thinking this is a problem with your setup. Thanks.

@gfosco gfosco closed this as completed May 12, 2015
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

4 participants