I have a proprietary application for automated testing that I built here at work that uses Selenium WebDriver classes to test our applications. It uses Firefox, but sometimes, when a new browser is launched, Firefox will open in Safe Mode and display the Safe Mode dialog. This seems to happen completely randomly, i.e. I will set up twenty tests to run and at any point this might happen. There only one block code that can be executed from test to test to launch a new browser, so it isn't in the testing application. Is there a way to override, or bypass, the safe mode dialog when this happens?
I need to run regressions overnight a lot of the time and it's frustrating when I see that my tests have been hung because of this
Related
When I run a suite of tests, Cypress is freezing on some tests. Different tests every time. At first I thought it was just tests that for some reason might take a while to run (like something that involves a timeout) but that doesn't seem to be the case. Running an individual test, with describe.only or it.only, does not freeze. Behavior is the same with cypress run in the command line.
When the test freezes, the spinner by the test in the Cypress pane still spins, but the app's UI is frozen -- for instance when my app's UI shows a spinner that spinner is frozen. Sometimes it even freezes on the VISIT / part of the test, before it even gets to any of the stuff that takes longer. Freezing happens in different spots, sometimes on different tests, on different cypress runs.
Also, even when a test file runs to completion, sometimes the Cypress UI (like the stop button at the top) doesn't respond.
This only started happening Friday, possibly coinciding with an update to 3.8.1. I've tried using 3.7.0 again, with no change.
Is anyone else experiencing this? I'm running on Windows 10 and the app is ReactJS.
If you are running Linux there is a bug related to Chrome 79 that freezes Cypress. Check here for more info: https://support.google.com/chrome/thread/24842699?hl=en
You can also update to latest Chrome version
How the problem was finally resolved ?
I encounter same problem but for some reason load event does not trigger even after 60.000ms; - I test app on different resolutions and sometimes, app doesn't load in some resolutions.
I've got a Selenium test which crashes my browser (Firefox) whenever it runs. It's just a simple test (login, logout, login, logout, login ... crash) and I can't reproduce the crash when I do the same things manually, so I think the problem is with Selenium itself.
However, the issue could be that my Firefox starts with different options than when Selenium starts it. I could confirm that's not the case if I could start Firefox the exact same way Selenium starts it (eg. without plug-ins, with all history cleared, etc.) ... but I'm not sure how to do that.
Can anyone tell me which options to use to make Firefox run the same way as when Selenium runs it?
I was never able to find out how to emulate Selenium's use of Firefox. I tried using a fresh Firefox profile, but that still seemed to have differences from how Selenium ran Firefox.
Instead I wound up re-writing my test to be two tests, and then it was able to log in/out twice in the first test and once in the second test, avoiding the issue I was trying to debug (which only manifests when I try to log in/out 3 times in the same test).
If anyone can provide a better explanation of how to emulate Selenium's running of Firefox I'd be happy to accept that answer.
I am using Firefox Selenium Web Driver to run automatic tests on a dedicated testing machine, so there is nobody pressing Shift there that would cause Firefox to start in the safe mode. But still several times a day Firefox starts with this safe mode dialog:
Any idea what could be causing this behavior?
Multiple tests are running at the same time, so there are several Firefox instances, can they maybe influence each other somehow?
I have disabled automatic safe mode after Firefox crashes as described here, but without success.
The reason is that some of my tests are running external AutoIt script that is "pressing" a Shift key to enter upper case letters. If another test is starting its Firefox at the same moment, Firefox detects the Shift key and displays the Safe Mode dialog.
osdHotkey simple utility that displays and logs pressed keys helped me to find out what is going on.
I would like to embed dojo/robot tests is java application.
Java application would use java-webengine for load web pages and for embed dojo script to these pages. Java-webengine gives possibility run java script.
I understand, that DOH use system mouse and keyboards events. User of my application does not see web browser page (browser running in background by webengine).
I have a couple of questions:
1. What happen with mouse pointer during DOH test execution?
2. It is possible to run DOH tests in my application internally(in the background)?
3. What happens if user will type on the keyboard or move mouse during test execution? (For instance user may switch for other application, e.g. Microsoft Word.)
Thanks!
A few things --
Dojo tests can be run from the command-line using node.js or Rhino.
I have created a DOH test suite that is backed with a Java web server and that works well, BUT...
To clarify, not all of the DOH robots use system mouse & keyboard events, only 1 particular robot (robotx) simulates actual user input. When using robotx, the mouse & keys behave as directed by the tests. If you mouse off the browser, the tests will be aborted (an alert comes up notifying you of this). Therefore, robotx cannot be run in the background because it is actually interacting with the browser.
You may have some luck using the other robots coupled with node.js or Rhino. The key concept is that you should be looking for some "headless" browser testing scenario, which is generally what Rhino handles (I believe Node can do this as well) while avoiding use of robotx.
Basically, as long as you are not using robotx (the one that actually takes control of UI) you should be able to start the tests & minimize the browser or use a headless browser engine.
I love firebug for helping debug my web apps, as well as seeing how others have implemented there sites. However firebug hinders memory leak testing.
I've just found that FireFox can be launched in safemode which disables all addons, which is great for memory usage testing however once firefix is launched (either samemode or not) all subsequent firefox launches (they all appear in task manager as 1 firefox instance) will use the mode of the first one.
I'd like to leave one in same mode testing some apps for leaks and use another with firebug to develop.
I've tried making a copy of the FireFix.exe and even copying the whole firefox directory but it still launches as one application.
I could always use VirtualBox to create a full virtual PC for this testing but that seams like a large overhead.
Edit
I have just tried the -no-remote switch but it just comes up with "firefox is already running .... you must first close the existing Firefox process.... "
First close all your Firefox instances. With all instances closed, run firefox via the "Run..." dialog on windows, typing "firefox -p". It will open with the profile manager, where you can create multiple profiles with different configurations.
After creating your profiles, just run you "main" browser using "firefox -p" and select your "main" profile. To open another instance using a different profile, run Firefox using "firefox -no-remote -p" and it will prompt the profile manager again, so you can choose a different profile.