In the following code, I have a variable linkLocation which I want to access in my JavaScript code. It shows error "Linklocation is not defined". How I will access the variable in the JavaScript code ?
IWebElement link = driver.FindElement(By.LinkText("soemtext"));
String linkLocation = link.GetAttribute("href");
Console.WriteLine(linkLocation);
((IJavaScriptExecutor)driver).ExecuteScript("window.open(linkLocation, 'groupPage')");
linkLocationas opposed to it's variable.