-
Notifications
You must be signed in to change notification settings - Fork 163
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
Webdriver unknown error : evaluate.js is not loading #163
Comments
how does your afterStep hook look like ? |
This is the exception trace. Exception trace:
|
I was not asking for the exception trace, but for the code of the hook in which the exception happens |
/**
* For javascript enabled scenarios, always wait for AJAX after clicking.
*
* @AfterStep @javascript
*/
public function afterJavascriptStep($event) {
$text = $event->getStep()->getText();
if (preg_match('/(follow|press|click|submit)/i', $text)) {
$this->iWaitForAjaxToFinish();
}
} |
I've added some formatting to your comments @deepaknik123 if you don't mind, to make them easier to read. |
There might be 2 problems, according to http://stackoverflow.com/questions/18114544/seleniumwebdrivererrorjavascripterror-waiting-for-evaluate-js-load-failed :
Can you please post the actual JavaScript being executed? |
@aik099 Thanks man! for the formatting. |
Based on issue you've posted it might be a bug in the used What version are you using? Listing the actually used versions of all composer packages on a project would be great help as well. |
I'm trying to upload an image in the image upload field which is in the iframe. After uploading the image there are two button "Next" and "Save". After clicking on "Save" the iframe pop-up closes and after that the content form becomes unresponsive and throws the evaluate.js not loading error. |
To me that looks like a JS on the Save button is owned by iframe, which is closed by that button and that ends up in JS being executed without real context. I guess such complex stuff Selenium can't handle. In general this is a problem too, because the function that you call after Save button press should be defined on main page and called from within iframe. This way is safer and Selenium might also be happy. |
Sometimes the form is submitting successfully but once in many executions of the feature. |
This only proves my suspect. Sometimes iframe closes fast enough to kill JS in the middle of execution and that creates an error. |
Is there any way to handle this situation ? |
As I said it's the problem in your application JavaScript code, not on Behat/Mink/Selenium side. Can you change your application code as I proposed (move JS from iFrame to main page)? |
Its a drupal application and the module being used for image upload is contributed by drupal community. So we can't change the code anyway. |
Then I'm out of ideas. You can debug the actual scenario and see what happens on a page as you execute steps. Maybe even enable JavaScript debugger (in browser). Then you'll be able to figure out the problematic code and figure out what workaround can be on your side (outside of iframe) to solve it. Then submit a fix to Drupal community, because surely somebody gets same problem while using the app as you when you test it. |
I'm facing this error while executing the following steps in the feature :
I'm getting the following error after the Save step.
The text was updated successfully, but these errors were encountered: