im trying to get the element using selenium by id and by XPATH but in both cases unable to locate error occurs. Code:
IWebDriver dr = new ChromeDriver();
dr.Navigate().GoToUrl("http://epaper.dawn.com/");
IWebElement today = dr.FindElement(By.XPath("//*[@id='planetmap']"));
Code of the element is
I have tried both id and XPATH method
The desired element is inside an iframe
, switch to it first :
dr.SwitchTo().Frame("DawnPaperFrame");
IWebElement today = dr.FindElement(By.XPath("//*[@id='planetmap']"));
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.