Is it possible with testcafe control browser clock?
In my case, I schedule a 30 minutes timeout and would like to test if after the 30 minutes the timeout is executed and obviously I want contorl the browser clock to avoid to get my test running by 30 minutes.
Sugestions?
TestCafe doesn't control the internal browser clock. I guess you should rethink your test case because it does not make sense to test the built-in browser functionality.
As sugested by #AlexeyLindberg I opened an issue on test cafe github repo #5098
Related
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 I run my selenium tests using a chrome browser all my tests cases run fine. When using the phantomjs browser it would appear that the browser session does not get reset after each test case. In my tests cases, I log in as a user to then navigate to certain pages and then logout. A problem occurs when a test case happens to fail. The browser session is not reset so when the next test case begins, the test that failed was unable to logout. This causes all test cases after a single failure to fail.
When searching the internet for a solution to this issue it been known sine 2013. I can't seem to find anything regarding this issue that's recent. Is there any up to date workarounds?
Manually trying to delete the cookies before or after each test case does not appear to work. webDriver.manage().deleteAllCookies();
I'm using phantomjs ver 2.1.1.
First of all PhantomJS is dead, you are better off switching to Headless Chrome or Headless Firefox.
Secondly PhantomJS is a port of Webkit which is not thread safe. This means that if you try and run more than one test in parallel you will see threading issues, to fix this you would need to start multiple instances of PhantomJS and have each GhostDriver instance connect to a different instance of PhantomJS.
The particular problem that you are seeing is that PhantomJS doesn't clear itself down properly, again the only solution would be to kill the initial PhantomJS instance you are running after your test finished and then start up a clean new one, unfortunately that is not supported by GhostDriver.
The final problem is that GhostDriver is dead as well, there was no point in continuing development when PhantomJS died.
TLDR; Use Chrome/Firefox Headless mode instead.
I am using selenium WebDriver using RobotFramework. The major problem we are facing is, my tests are timing out even after setting timeout as high as 10 minutes. It happen with any browser I use. These thing works much faster If I run test manually (with all browser cache/data/cookie cleared). These are the other things I have observing for few months.
Some component are never loaded (I check the call trace using BrowserMob Proxy and we found nothing unusual)
"Click Element" does not work in many cases. Clicking on element triggers some action but that action is not always trigerred in automation. Manually it works all the time.
Notes:
This is happening on FF and Chrome. (IE is not working for me at all)
App server and automation suite is in LAN so latency is not an issue
No other heavy process is running at this time
Issue persist even if with firefox default profile
I tried it with different selenium versions. (2.45 - 2.52)
I took latest driver for chrome. Broweser: FF 40+ and GC 48
This does not look application issue as we spent 2 month confirming that. Let me know if you need any other detail.
We would love to adopt Nightwatch.js for testing on browsers, but we're stuck on one major caveat: at the time of this writing, Nightwatchjs does not support running different tests using the same browser session. In short, it means that:
Creating the browser session is handled by the Nightwatch module from lib/index.js, in the startSession function;
Killing the browser would correspond to the delete command place in the Selenium action queue in the terminate function of that module;
A new Nightwatch client is created at every test run, which happens every time we load a different test file;
According to this source, it is possible to reuse the current browser session in Selenium, instead of opening a new window.
Has anyone managed to fix this problem in Nightwatch?
Here's the feature request on Github, which was requested on Mar 31, 2014 and is still open.
Another approach would be to circumvent the problem altogether by getting Nightwatch to merge all different files into one Test Suite, but that seems to be harder to solve than the problem with sessions...
Nightwatch now has support for resuing browser sessions. You can simply use the flag --reuse-browser to reuse sessions while running your nightwatch tests.
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.