Forum Discussion
The solution would be as Scot1967 and rraghvani pointed out to use browser command line to disable security. However, since you are using an embedded browser in your application you need to figure out if you can accomplish that. You will probably need to consult with your developers.
You can also ask ChatGPT for tips on: In TestComplete when testing a "Windows Store application" with embedded browser, I get error "To get access to the frame content, the browser must be launched using special command-line switches."
The solution would be to run browser with command line switches to disable security. How to accomplish that for an embedded browser in windows application?
JavaScript example to run browser with required command line argument and is specific to Chrome, if your application accept command line to pass to the embedded browser and it is Chrome you can try it.
// Run Chrome with command line to switch off security
function RunChromeSecurityDisabled()
{
// Get user profile path, and build command line argument
USERPROFILE = aqEnvironment.GetEnvironmentVariable("USERPROFILE");
CommandLine = "--disable-web-security --user-data-dir=\"" + USERPROFILE + "\\AppData\\Local\\Google\\Chrome\\User Data\\Default\" --disable-site-isolation-trials --disable-hang-monitor --disable-renderer-accessibility";
Log.Message("Chrome CommandLine = " + CommandLine);
// Run Chrome with command line
Browsers.Item("chrome").RunOptions = CommandLine;
Browsers.Item("chrome").Run();
}
- mohcine5 months agoNew Contributor
Exactly, I have an application that is embedded in an browser Edge, I will check with the developer