Normal Edge launch along with Private Edge mode. (Random issue)
I am facing a random issue as I want to launch Edge in Private window then start execution in same.
Sometimes it is working fine but sometime I launches Edge in Private along with with Edge in normal mode, due to this my script fails.
Using below script then calling same in Keyword test.
function LaunchEdgeInPrivate() {
// Path to the Edge executable
const edgePath = "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe"; // Ensure this path is correct
// Command line argument to open in InPrivate mode
const edgeOptions = '--inprivate';
// Full command to execute
const command = `"${edgePath}" ${edgeOptions}`;
// Create a WSH Shell object to run the command
var wshShell = Sys.OleObject("WScript.Shell");
// Run the command (0 = run in background, 1 = activate window)
wshShell.Run(command, 1, false); // false to not wait for completion
}
Keyword test: