I am using a IWebDriver object.
The Webpage contains dynamic div's. I have used to access the div's(elements) by using Xpath/Id or anything.
So i have tried something like this
List<IWebElement> webElement = chromeDriver.FindElements(By.XPath("//*[@id='dp_widgets_simplegrid_Grid_8']/div/div[1]/div/div[1]/div"));
int rowsSize = webElement.Size();
It gave type casting error.
Cannot convert system.Collections.ObjectModel.ReadOnlyCollection to System.Collections.Generic.List
Then I have tried like below:
IWebElement webElement = chromeDriver.FindElement(By.XPath("//*[@id='dp_widgets_simplegrid_Grid_8']/div/div[1]/div/div[1]/div"));
int rows = webElement.FindElements(By.TagName("div")).Count;
But Still i could not find the list of elements in the dynamic grid.
I want to get the list of div elements . Could anyone give me a little idea about that?