Dismissing the accept cookies dialog - cypress

For the web app that I am automating (cloud.redhat.com/openshift), I am working in a "preserve all cookies" mode:
Cypress.Cookies.defaults({
preserve: /.*/, // match-all regexp
});
When I run my script - it correctly dismisses the accept cookies dialog that pops up right on the start, and proceeds to feeding in the login credentials. So far so good - but then the accept cookies dialog pops up a 2nd time :(, and this time Cypress doesn't dismiss it and gets stuck because the dialog covers the whole page.
Another peculiarity is that this problem doesn't happen when I run the script from the development environment, when I use "cypress open". It only happens when running the script from the command line, when I use "cypress run". The problem can be recreated in development as well if I switch from Chrome to Firefox. Why is there a difference between the behaviors when using "cypress open" and "cypress run", and when using a different browser? How can I dismiss or prevent the dialog from popping up a 2nd time? We're on Cypress 7.7, but I also tried recreating the problem in Cypress 10 and it happens there too.

Related

Starting Chrome on macOS from the Finder with extra command line parameters

I want to stuff remote debugging and other esoteric dev-only only parameters to the Chrome application when it starts but I want it to be always there, including when I click on the app icon.
E.g.:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
How do I pass these command line parameters to the app directly?
I ended up creating an automator application with as shell task. Customized the icon and replaced Chrome.app with the new app in the dock.
I am still looking for a way to change the settings in Chrome so it can connect with remote debugger "on-demand" for specific tasks (not everything as it is set now) but that doesn't seem to be possible at this time. The VSCode folks have apparently solicited the Chrome team to provide this functionality. Stay tuned...

React Native Debug (Chrome): "Activate Breakpoints" not working as expected

In a React Native project, I have some breakpoints (in Google Chrome DevTools).
I then decide to deactivate them and switch the "Activate Breakpoints" button to "blue" color:
...which works (no breakpoints are triggered while I continue running the application).
However, when I reload the application the breakpoints do trigger despite the "non-activated" flag exists:
This should not be happening.
The only way to ignore the breakpoints is:
- Activate them again
- Press F8 to continue
- Deactivate them
(then, the application continues running without breakpoints).
Is this a known bug? Do you also experience it and if yes is there any solution to this?
Thank you!
RN developer tools are still in testing phase. For MAC they are more stable than comparing to windows. The reason is actually the bundling of assests and js files.
the console takes it as a single file and then distributes it to different files that are showing in the workingdebugger.js file.
So it recreates them every time you reload the app.

Credit Card Transaction script fails webdriver, if another window is opened manually

I am executing credit card transaction script through webdriver. So there is form where the details are to be filled and then click on “Submit” button to perform successful transaction.
Here, transaction script gets executed on firefox browser, and in between if another browser say Safari is opened manually, then transaction script which is getting executed on firefox through webdriver, it gets fail
Environment : WebDriver 2.43,
Firefox Version: 32.0
Please correct me, if i am performing anything wrong
The first thing you should do is, you need to switch to new window from initial window and then perform some operation and switch back to your initial window.
To know how to switch between windows, watch this video.How to switch between multiple browser windows using webdriber

Launch "safe" Firefox

I'm trying to run jasmine unit tests on a CI server. To do that I have to launch a browser (FF in my case.)
I have a vnc server running on the server, so the browser has a display to attach to. However, when the browser is killed or terminated ungracefully (which can happen if a build fails), If I simply run "/usr/bin/firefox", I get a pop-up message from Firefox, and obviously the tests won't work.
Is there a set of flag I can use to always launch FF (as if it was a regular startup ?)
Note that :
/usr/bin/firefox -safe would not work, as it opens a popup to warn about safe mode
/usr/bin/firefox -P xyz would not work, as it opens a popup to define the profile
Thanks

Why does Selenium Webdriver start failing tests if I focus off its FireFox window?

I have some SeleniumWebdriver/TestNG tests that Im successfully running on FireFox. If I am watching the tests run, it is okay.
But If I start using another browser in the meanwhile, or skype for example, and I go back to the FireFox window that is running the tests, I always find out that some error has occurred - for example, the "User name" input hasnt been filled out.
Why does this happen, and how can I prevent it?
Try to use driver.switchTo().window(driver.getWindowHandle()); when filling out the form.

Resources