I am currently working on adding a new element and I need to retrieve a URL as the response. However, I am unsure of how to capture the response from this new element. Any advice or suggestions would be highly appreciated.
public void Initialize()
{
IJavaScriptExecutor js = (IJavaScriptExecutor)driver;
driver = new ChromeDriver("C:\\SeleniumDrivers\\");
driver.Navigate().GoToUrl("https://www.target.com");
driver.Manage().Window.Maximize();
Thread.Sleep(3000);
string scriptExecution = "var document = window.document;"+
"var head = window.getElementByTagName(\"head\");"+
"var script = window.createElement(\"script\");" +
"script.setAttribute(\"type\", \"text/javascript\");" +
"script.setAttribute(\"src\", \"https://go.playerzero.ai/record/6274691b00fbad01561df689\");"+
"head.appendChild(script);";
try
{
js.ExecuteScript(scriptExecution);
}
catch (Exception error)
{
System.Diagnostics.Debug.WriteLine(error);
}
}