Cookies consent popup - Blocked a frame with origin "https://www.wtwco.com" from accessing a cross-origin frame - cross-domain

I am having issues with the below test scenario I am trying to automate using Cypress:
When I navigate to http://www.willistowerswatson.com/ICT, a pop-up for cookies is displayed. I think it's an iframe:
I want to click the "Agree and Proceed" button in order to verify text on the landing page.
Here is my current test code:
 it('Navigate to landing page', () => {
        cy.visit('http://www.willistowerswatson.com/ICT');
        cy.frameLoaded('[id^=pop-frame]')
})
When I run this test, I get this error message in Cypress explorer:
Blocked a frame with origin "https://www.wtwco.com" from accessing a
cross-origin frame.
Can someone please tell me how I can get around this to proceed with the test scenario?

I could not replicate your screenshot. I only saw the cookie banner at the bottom of the page. There may be a cookie created after accepting and proceeding. You could create the cookie beforehand to bypass the the pop-up. You may also be able to click outside or hit esc to remove the pop-up as a workaround.

Related

Goggle - Cannot create credentials

Cannot create credentials, when I click the "Create credentials" button in the credentials page in console.cloud.google.com, the page will show a list, "API Key", "OUauth client ID", etc as you can see in my screenshot. I want to create an API Key, but the option cannot be clicked, when i set my cursor to the option, "Navigation menu" tooltip appears, and when clicked, it will show the page menu. How do I fix this? Anyone have similar issue? I'm using chrome, trying in firefox but to no avail.

Python Selenium webdriver methods are getting failed with Timeout exception when a modal dialogue box is popped up

1)I am using python and selenium to test an invalid login scenario for a webpage authentication.
2)Once I am passing wrong credentials, a modal dialog appears on the screen.
3)After the dialog box pops up, any action I try to perform with the driver object , the command gets failed with Timeout exception.
4)I am unable to move the cursor nor click the ok button on the dialog box.
5)There is no iframe or alert message. Its a dialogue box.
6)The underlying code for webpage is in typesscript and html as markup lang
Can someone please guide?

How to fetch the value of a key from localstorage which is stored in your browser in a Chrome Extension

I am new to developing Chrome Extensions.
I am trying to get the values for one of the keys which is stored in my browser's localstorage (inspect -> Application -> Localstorage). What I want to do is in my Chrome Extension, when you click a button, I just need it to fetch the value from localstorage for the page which is open in my browser's current tab.
This is the JS function which I am using -
chrome.storage.local.get(['granted.selected'], function(result) {
console.log('Value currently is ' + result.granted.selected);
});
granted.selected - is the name of the key whose value I want to fetch.
When this executes, I get "Value currently is undefined" whereas I want it to fetch the values stored in the above key (granted.selected).
What do I need to add to have this fetch the value for that key from my current open tab's localstorage?
In short - Just want to access a webpage's localStorage from a Chrome extension.
Any help will be greatly appreciated. Thanks!!
chrome.storage.local is not localStorage, it's a completely different storage API.
localStorage is a DOM storage.
To access DOM of a web page you need a content script [1].
Here's an example of programmatic injection in the popup script or in the background script:
chrome.tabs.executeScript({
code: 'localStorage["keyName"]'
}, ([result] = []) => {
if (!chrome.runtime.lastError) {
console.log(result);
// use the result here inside the callback
}
});
Notes:
You'll need permissions in manifest.json as explained in [1].
keyName is the name of the key as seen in devtools "Application" panel of the web page
each part of an extension has its own devtools console.

instagram Invalid header: X-Insta-Forwarded-For is required for this operation

I have a problem when I try to give a picture admired by instagram api
Error message that appears to me
stdClass Object ( [code] => 403 [error_type] => OAuthForbiddenException [error_message] => Invalid header: X-Insta-Forwarded-For is required for this operation )
Code which is used to give the image impress
print_r($instagram->likeMedia(783976945516349891_353981601));
can you help me :(
I believe what you have to do is turn off the Enforce signed header option on your Instagram API developer account.
Go to http://instagram.com/developer/clients/manage/ (you may have to log in)
Click the Edit button to the right of your application name
Scroll down to the bottom of the page and unclick the 'Enforce signed header' checkbox
Click Update Client
That should get rid of your error.

Cross-origin permissions from chrome-extension:// pages?

I want to "proxy" web pages through a chrome-extension:// page (using an full-frame iframe), so that they show up as an extension page, instead of a webpage. I still want to apply content scripts to them, however, and have not had any success doing this. Is there a way to allow the chrome-extension page to access the contents of the iframe because it's "privileged" and should be allowed to get around XSS limitations?
Whenever I try to executeScript( { code : blah , allFrames: true }) I get an error about XSS about the chrome-extenion page, not the http page inside it...
Ideas?

Resources