I have observed that whenever I run my automated script along with reporter, the test runs through successfully but the testcafe process does not end. After closing the application browser the testcafe run window never closes. This happens only when run command includes reporter details like
'testcafe chrome RegressionTestHappyFlows/calculatePremium_ShortTermTravelInsurance.ts --env=Test_English_ET --reporter html:TestRun.html'.
If I remove the reporter details from the command then the testcafe process ends properly as expected. I have tried with testcafe-reporter-html(version : 1.4.6) and also with multiple-cucumber-html-reporter(version : 1.18.0). In both cases I face the same issue. Testcafe version that I am using is 1.9.1
Could some one please help and suggest me a solution.
Thanks
Related
I started out trying to learn how to write automated tests for a small project but nothing was working right out of the box. After a couple hours of searching & experimenting I found the right configuration for my project & figured sharing it might help folks in the future.
Here's a small summary of the errors I encountered on this debugging journey:
Using Jasmine & WDIO, send_keys was crashing
It was a Firefox/geckodriver bug, or something like that
WDIO appeared to hang after switching from Firefox to Chrome
Chrome needed to be run in --no-sandbox mode, essentially
I figured my problem was probably stemming from having WDIO execute my tests on my local machine while Selenium was hammering on the browser in a Vagrant VM. So this will mainly be applicable for people using separate environments (vagrant->local, vagrant->vagrant, docker->local, etc) for WDIO & Selenium/Chromedriver. Here is a gist of the configuration file I ended up with.
I started with fanatique/vagrant-selenium-vm and modified it to use Chrome instead of Firefox because send_keys was broken with Firefox/geckodriver at the time of writing. After swapping out the packages, I'd start the tests with wdio but it would appear to hang. Turning on verbose logging showed it trying to start but failing with no explanation why.
[00:06:39] COMMAND POST "/wd/hub/session"
[00:06:39] DATA {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"browserName":"chrome","loggingPrefs":{"browser":"ALL","driver":"ALL"},"requestOrigins":{"url":"http://webdriver.io","version":"4.6.2","name":"webdriverio"}}}
It took removing the & from the nohup java ... command in fanatique/vagrant-selenium-vm's setup.sh to see the logs from Selenium in real time, then I was able to see a "only local connections are allowed" message from chromedriver. That led me to a SO post that said to add --whitelisted-ips="" as an arg to chromedriver - but I was still getting the local connections error message. Chrome itself ended up needing a --no-sandbox flag - that allowed WDIO to connect to the chromedriver in Selenium and my tests ran from there.
I have a local selenium server (2.42.2) running with Chromedriver and Firefox. It seems to get stuck after loading and running client.html. I can see that my functional suite code runs in node, far enough to execute the main body. Anything in registerSuite never gets called.
Here are the selenium logs:
http://pastebin.com/KKg5ycvW
I can see the browsers in the selenium sessions page, but they don't appear to be doing anything.
Try opening up a new browser window and paste in the url that you see in the existing selenium ones. Then open up dev tools and see what console errors you are getting.
Intern's runner seems to get stuck in an infinite loop if any uncaught javascript errors are thrown during unit tests if the 'reporter' hasn't been setup yet.
This has been raised as an issue in intern's github repository.
I'd like to start Selenium as a Grunt task, run Cucumber, then stop Selenium after Cucumber exits.
I tried using grunt-shell to start Selenium. While this works, Selenium continues to run (as expected) and so Grunt hangs waiting for it to exit.
I also tried grunt-bgshell. This starts Selenium, but Grunt immediately starts Cucumber before Selenium is ready, and then Selenium continues to run after Grunt exits.
As a workaround for stopping Selenium I could probably use shell and curl to send the shutdown request to Selenium. But if there's a way to accomplish this without a workaround that would be even better.
Update
See my answer below:
David Souther has written the grunt-selenium-launcher plugin which does exactly what I needed.
However, even after using the grunt-selenium-launcher plugin, Julien Biezeman helped me discover the best way to solve my problem was to launch selenium directly from my end to end tests in Cucumber using selenium-launcher.
I hope this helps someone!
Is it possible when running an entire test suite to make it stop on an assert failure?
It currently stops running that failed test then continues to run the next test.
I want it just to stop and fail on the first failure.
Thanks
I found https://addons.mozilla.org/en-US/firefox/addon/power-debugger-selenium-ide/ which is a Selenium IDE plugin which adds a Pause on fail button to Selenium IDE.
In selenium ide we can add Pause on fail button by simple install one plugin in the selenium IDE. When pause on fail is turned on, Selenium IDE would pause the execution of the test case when there is an error is produced or a command failure
Install plugin from https://addons.mozilla.org/en-US/firefox/addon/power-debugger-selenium-ide/
don't know if you ever got this issue resolved but I use a plugin to cater for this issue.
The plugin is 'Selenium debugger' and I was able to download it from
https://addons.mozilla.org/en-US/firefox/addon/power-debugger-selenium-ide/
install using firefox. Then, once firefox has restarted, an additional icon will appear on the Selenium toolbar (pause on fail). Works a treat for me!
The only thing of note is that if the script fails on the last line of a test CASE it may still continue to the next test case in the suite. The way round this that I use is to add a 'pause 100' entry to the last line of each test case so that the plugin can 'hook' onto it.
I hope his helps
You could write the assert into if and on false stop the run.
I have a problem with Selenium under Jenkins 1.446 together with Xvfb: It looks like firefox is started correctly because I let my failing tests record screenshots. These screenshots all show the same failing page, which in my case is the starting page where the tests should begin. So I gues the selenium WebDriver commands do not arrive. What could be the reason? By the way, the tests are running perfectly on my local machine.
I'm using Firefox 9.0.1 with no specific test profile and no AddOns, Ubuntu 10.04, Senlenium 2.16.1
Log entry: com.thoughtworks.selenium.SeleniumException: Timed out waiting for action to finish
Thanks!
EDIT: Issue seems to be fixed by a system reboot ...
I experienced a very similar issue with FF9.0.1 and Selenium 2.16.1 running through JUnit launched by Maven SureFire plugin run by Jenkins on a WinXP node.
2.17.0 fixed the issue for me. Try updating to the latest Selenium.
Through RDP, I was able to watch the tests running. The tests appeared to be partially blocked by a prompt from Firefox asking about collecting anonymous usage statistics. Manually answering the prompt would allow the test to continue but because Selenium creates a new profile each time by default, the prompt would return on the next browser launch. Running the tests locally with a pre-configured FF profile allowed me to persist that the prompt had been answered. This isn't possible on my XP node because the tests are running as 'System'.
Selenium/WebDriver would normally take care of this for you by marking the prompt as already answered in a temporary FF profile configuration but a bug was causing the value to be set to the wrong value. You can inject a profile configuration to the Selenium FirefoxDriver driver to pragmatically configure stuff like this prompt but the bug appeared to prevent this as well. This has been resolved in Selenium 2.17.0 (http://selenium.googlecode.com/svn/trunk/java/CHANGELOG see 2.17.0 WebDriver bug fixes).