driver.Navigate().GoToUrl("http://www.google.com");
var title = ((IJavaScriptExecutor)driver).ExecuteScript("return document.title");
System.Console.WriteLine("Title of the window : " + title);
var js = (IJavaScriptExecutor)driver;
var length = js.ExecuteScript("var links = document.getElementsByTagName('A'); return links.length");
System.Console.WriteLine("Length of Element : " + length);
0 comments