Error Cypress chrome-error://chromewebdata/ - google-chrome

I tell you my problem, I was testing the cypress tool on a page that makes purchases online, when doing a test with the following code:
let button_add_cart= "#add-to-cart-button-4";
//cy.wait(3000);
cy.get(button_add_cart)
.click();
//cy.wait(5000);
//let button_2= "#topcartlink > a > span.cart-label";
cy.get('#bar-notification > div > p > a')
.click();
The second Get references another to href,this when executed, I throw the following error first
enter image description here
To solve this I should add en archivo cypress.json the property "chromeWebSecurity": false. But when added it throws me the error chrome-error://chromewebdata/
enter image description here
By also adding the property "baseUrl": "http://demo.nopcommerce.com", this domain change but when changed as shown in the image, it does not pass the added articles, which breaks the test flow.
cy.visit('/cart');
let value= ".product-unit-price";
let costo = "$1,800.00";
cy.get(value)
.contains(costo);
When changing path this should pass me the added items
I would appreciate the help

Upgrading the version to 6.1.0 helped me get rid of same issue.
I did following steps for updation:
Update cypress by either of command npm install --save-dev cypress#6.1.0 OR yarn upgrade cypress#6.1.0
Execute by command $node_modules/.bin/cypress open

In my case, I was getting chrome-error://chromewebdata/ because the test involved submitting a <form> into a URL that wasn't responding.
It was <form method="POST" action="https://localhost:8443/something"> but there was no server listening at localhost:8443, I forgot I was using another address.
So it was a good thing the test failed (the test was wrong), but I wish Cypress told me something like "Unable to connect to localhost:8443" instead of saying chrome-error://chromewebdata/. I would have noticed my mistake much sooner...

Related

golang chromedp ERROR: could not unmarshal event: unknown PrivateNetworkRequestPolicy value

I'm getting ERROR: could not unmarshal event: unknown PrivateNetworkRequestPolicy value while fetching amazon using chromedp. Tried with different user-agents but nothing works.
github.com/chromedp/cdproto v0.0.0-20220816211547-b8b15824df23 github.com/chromedp/chromedp v0.8.4
Google Chrome 104.0.5112.79
What is wrong
Google Chrome 104.0.5112.79 has such policies (see browser_protocol.pdl#L6178-L6184):
Allow
BlockFromInsecureToMorePrivate
WarnFromInsecureToMorePrivate
PreflightBlock
PreflightWarn
And github.com/chromedp/cdproto v0.0.0-20220816211547-b8b15824df23 supports the same list of polices (see cdproto).
So the error looks impossible.
What to do next
The last change to PrivateNetworkRequestPolicy is 97.0.4665.1_9.7.3 which adds two new values:
PreflightBlock
PreflightWarn
Please double check the version of the chromedp/cdproto package and the version of the browser.
Now that Chrome 105 has been released, please upgrade to this version. Maybe it will address the issue.
It will be helpful if you can enable the debug log to record what is the invalid value. Enable the debug log like this:
ctx, cancel := chromedp.NewContext(ctx, chromedp.WithDebugf(log.Printf))
updating chromedp to the latest version fixed the issue.
Refer: https://github.com/chromedp/chromedp/issues/797
go list -m github.com/chromedp/cdproto
github.com/chromedp/cdproto v0.0.0-20221126224343-3a0787b8dd28

Google App Script for Tag Manager Container List

I am running a google app script to get a list of containers for my GTM account. I have the follow piece of code:
TagManager.Accounts.Containers.list(parent)
parent = my GTM account ID, I even tried putting as a string, EG "xxxxx". I am sure the GTM account ID is correct.
The following error is returned:
Uncaught Error: Response Code: 404. Message: Not Found.
at fetchContainers (Code:19)
Can anyone please help me?
"Parent" is a path:
Inserting just the ID will give an invalid path, and since the API client tries to retrieve a response from that path an invalid path will result in an error.
You need to use a call like this:
TagManager.Accounts.Containers.list(
'accounts/' + accountId,
{fields: 'container(name,publicId)'}
).container;
You can find a complete and working example here:
http://www.appsscript.it/tutorial/lista-dei-containers-di-google-tag-manager-in-spreadsheet-con-google-apps-script/

Google Chrome: DOMException: Registration failed - manifest empty or missing

I am trying to implement Push Notifications on my website (using Pushpad). Therefore I created a "manifest.json" with following content:
{
"gcm_sender_id": "my_gcm_sender_id",
"gcm_user_visible_only": true
}
of course I created a valid GCM-Account and have a sender id
I put the manifest.json into my root directory and I also added this line to my index.php:
<link rel="manifest" href="/manifest.json">
Using Firefox everything works fine and I can send and receive push notifications (so I think the manifest-include works fine), but Chrome won't work...
The console shows following error:
Uncaught (in promise) DOMException: Registration failed - manifest empty or missing
I searched Google for a long time and tried everything I found, but nothing works.
What I tried:
created the manifest.json with "Editor" and saved it as type All Types (so no hidden .txt-file) and also with UTF-8-Encoding.
restarted Chrome
cleared Chrome's cache, history, etc.
I really hope somebody can help me.
For me it was a redirect. The manifest.json must return a 200 status code (must be directly available from the server), without any redirects.
You can check the response via
wget --max-redirect=0 https://example.com/manifest.json
or
curl https://example.com/manifest.json
I faced same issue,added manifest file right after head tag . which worked for me.Cheers!
This may be an issue with your Service Worker scope. I ran into a similar problem when I rearranged my files/directories. Make sure your sw.js is on the same level as your manifest.json, otherwise the service worker won't be able to find your manifest. Try putting them both in the root of your directory. Optionally, you can specify the scope of your service worker by adding it to serviceWorker.register():
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw-test/sw.js', {scope: '/sw-test/'})
.then(function(reg) {
// registration worked
console.log('Registration succeeded. Scope is ' + reg.scope);
}).catch(function(error) {
// registration failed
console.log('Registration failed with ' + error);
});
}
Read more here:
https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers
Was wondering if your "manifest.json" is public accessible ?
If not maybe you can try to set it public accessible to see if that helps or not.
And it seems that the current chrome, when getting the "manifest.json" won't supply the cookies.
Because I didn't find an answer anywhere out there in the WWW, but managed to get it working after some time I want to provide my solution/answer for other users, who probably have the same problem:
In the file where I inlcuded the Pushpad files I wrote some PHP-Code before the <head>-Tag to include some files, e.g. for database connection. After I moved the PHP-Code below the <head>-Tag everything worked fine.
There seem to be three ways to fix this bug:
a) No redirects for "manifest.json" file.
b) Put a link to this file at the top of the tag.
c) Be sure, that there is no other manifest file before this one, cause it seems that web push script will try to import the first one and return an error due to the wrong data.
I have tried all three and finally forced Chrome to behave.
Adding the following block fixed this for me:
self.addEventListener('push', (event) => {
const title = 'Get Started With Workbox';
const options = {
body: event.data.text()
};
event.waitUntil(self.registration.showNotification(title, options));
});

Service Worker not prompting to be registered - net::ERR_FILE_EXISTS

I browsed through the other threads - there was no concrete answer.
I implemented a service worker for notifcations
http://docs.pushwoosh.com/docs/chrome-web-push
I checked everything - all scripts are in root, the keys are well implemented. However, I do not get prompted to allow notifs.
Console output reads:
GET https://mydomain/service-worker.js net::ERR_FILE_EXISTS
Note: I do have the correct URL (just changed it here).
What causes the service worker error? How do I fix this?
It isn't anything to worry about. See the internal bug report: https://code.google.com/p/chromium/issues/detail?id=541797 the TL'DR is that when Chrome tries to fetch a new SW if there is no change and thus nothing to install it throws this error message to indicate that state. There is nothing that you need to do.

Newbie: Getting basic app script to work, encountered AppKey error

I am following the instructions here to get a basic appscript to work. When I load the given page ("quickstart.html"), it does properly prompt me to "authorize" the connection. After authorizing, it redirects me to an error page with the error:
[ORIGINAL ERROR] generic::not_found: com.google.apps.docs.error.DocumentNotFoundException: Invalid or missing required AppKey
The invalid/missing AppKey suggests that this is a basic configuration issue. Other than the html file itself, where else should I be looking to find how/where the "AppKey" is managed?
Aha, figured it out. I had neglected to fill in the ENTER_YOUR_SCRIPT_ID_HERE variable. That was easy! :)