Manually setting QUARANTINE_THRESHOLD and DISCONNECT_THRESHOLD in testcafe does not work - testing

I changed the QUARANTINE_THRESHOLD and DISCONNECT_THRESHOLD in test_run_controller.ts file to 1 million each and built successfully however, my test still fails after around 1000-10000 restarts with the error :
ERROR The Chrome 89.0.4389.90 / Linux 0.0 browser disconnected. This problem may appear when a browser hangs or is closed, or due to network issues.
Is there something else that may be forcing testcafe to quit? or is the issue in browser perhaps?
Thank you

According to the error, your browser hangs for some reason. The problem could be in the way you organize your tests. It's likely that you have some code that leads to memory leaks, and after 1000-10000 restarts, your machine does not have enough RAM to run the browser.
Please clarify why you need to restart your tests 1000-10000 times.
I changed the QUARANTINE_THRESHOLD and DISCONNECT_THRESHOLD in
test_run_controller.ts file
We are working on the quarantine mode configuration, so you will have the capability to change quarantine options out of the box.

Related

Playwright - URL is not loading sometimes

when I start the test, the browser is opened but it does not load the URL.
After 10-15 seconds it stopped to load (see screenshot).
I had updated intelliJ, updated playwright to version 1.28.1 (doesn't help)
It happened 7 out of 10 trials.
Any idea why it suddenly becomes that behavior?
Many thanks!
there are 3 probabilities causing this error when hitting the URL:
Your browser version could be a outdated which the site is blocking, so try updating playwright browsers using the command 'npx playwright install'.
Check whether the site is being blocked due to any firewall or proxy setting and if so, get it whitelisted.
As the request also seems to be a crash due to timeout, kindly check whether you have decent internet speed.

What is the possible causes that browser out of memory only when run with testcafe?

I have a test that run 30 times open & close a sub-webpage. And if I manually close and reopen, the web app runs okay, no issues at all.
If I use TestCafe to close and reopen for 30 times, I have error on the browser after around 20 times:
Error code: out of memory. like the screenshot shows.
And this will make my test hang then disconnect. I wonder is there any difference on TestCafe when storing & removing cache? Has anyone encountered or know about this issue?
Any help is really appreciated!
It can depend on the environment (website, operation system, hardware, etc.). If it can be reproduced on any machine, please submit an issue to the TestCafe repository.

When macbook is locked, selenium safari tests initiated by Jenkins on the mac wont run

I have made sure that the mac does not sleep by adjusting the settings in the system preferences. Jenkins will start the test on a schedule, the browser comes up but the test fails because the page is blank.
The same test works with no problem if the mac is unlocked or the screen save is not up.
I cannot leave the mac unlocked because the test runs at night and its a security issue.
Has anyone encountered this issue? And have a solution. Please share.
Attaching some logs. This image will give an idea of what I am describing.
You can try to run tests on locked computer when:
you set your display never turn off, when you lock your computer
you made sure, that computer never goes in hibernate or sleeping mode
If it will not work you can use two more possibilities:
run your tests on headless browser. Here is a pretty good explanation how to do it.
run your tests on a remote screen via VNC or RDP
EDIT:
You can try not lock the screen, but instead start the screensaver, and require the screensaver to immediately require a password.

Running Selenium with IE11 for several minutes results in the browser freezing

When running several tests synchronously using Selenium with IE, after about 10 minutes the browser starts to freeze. The browser will not render pages properly or respond at all. I can only diagnose that when these symptoms occur, the Memory reaches about 1.7G and hovers around there. I use Capybara so after every test, on average about every 30 seconds, it will reset the session. This issue does not occur when I use Firefox or Chrome.
Does anyone have any thoughts? I could try figuring out why it stops at 1.6G, but I imagine I'd hit the same issue once hit what ever new cap is set. I could also restart the process every few tests, but that would slow the test run down dramatically.
Configuration:
OS: Windows 7 64-bit
Selenium grid: v2.46.0
IEDriver: 32-bit
v2.46.0.0 (Tried using 64 bit but sending keys went very slow)
Browser: IE11
Thanks in advance for thoughts you might have.
We ran into the same problem and noticed that every character typed using sendKeys() consumes around 2 MB (!) in IE. We now restart the driver every 10 tests, which works for us.
Note: you could try replacing webElement.sendKeys with a Windows API call like SendInput and see if the problem in IE still remains.

Can the karma-script-launcher also close something after the tests finish?

I'm using the karma-script-launcher to open a virtual machine/browser/url but when the tests are complete I don't know how to close everything.
If I leave the browser open in the virtual machine it eventually stops trying to reconnect - no error message just fails to reconnect. I'm not sure if this is a bug or not. I can't see why you wouldn't want the browser indefinitely trying to reconnect? What ever the reason it leaves me needing to close and re-open the browser each time I run the tests. But if I'm using the script launcher I don't see how this is possible.
Thanks for any help
not quite sure if this covers your answer but I stumbled over your question while looking for a solution to a similar issue, so let me explain - in case someone else encounters this issue.
Was running karma unit tests on codeship ci environment for a nodejs app.
Tests were successful, however the test would keep watching and wouldn't shut down, thus setting the tests to 'passed' - instead it would idle and after a while timeout, setting the tests to 'failed'.
Setting the option singleRun to true within the karma config helped.
Hope this helps anyone who's having the same issue.
Sorry if not topical enough :S