I am trying to get text from all the threads in a chat, and they are of same name.I Intend to put them all in a txt doc. e.g
<div data-tid="message" dir="auto"><div>Text1</div></div>
.....
<div data-tid="message" dir="auto"><div>Text2</div></div>
I am trying to use a loop to get text from all divs, but cannot get attribute within loop.
IReadOnlyCollection<IWebElement> chatRow = driver.FindElement(By.XPath("//*[@data-tid='message']/div"));
for (int i = 0; i < chatRow.Count; i++)
{
GetAttribute("innerHTML");
}
Is there a way a do it without a loop? or how to get attributes from within the loop?