Our current automation process involves using selenium. In order to open 2 URLs simultaneously, we have implemented the following approach: I use driver.get to load the first URL, which includes built-in synchronization for page loading. For the second window, I make use of the below code snippet -
String jscript="window.open('"+strURL+"')";
js.executeScript(jscript);
If I incorporate a wait, the window loads and the switch operation works smoothly. However, I want to avoid hardcoding a specific wait time. How can I verify if the second window has fully loaded?
I tested the following method, but it results in a permission error on Edge -
String jscript="var win=window.open('"+strURL+"');win.onload=function(){}";
js.executeScript(jscript);