It is in relation to this question. Reload DOM element in selenium webdriver after some new tag added. But I want to take this one step further. I have a table, and I basically get the element down to the row level. When you click it, it opens another table within its row. I then want to grab that table, from within that webelemnt of row that has a new table in it. I would not like have to go through the main table of rows to get to the row that just opened. Do I need to do this, or is there someway to reload the already loaded element with what was updated?
var section = Driver.Instance.FindElement(By.TagName("tbody"));
var table = section.FindElement(By.Id("UP2"));
//set the values and get the new calculation
var rows = table.FindElements(By.TagName("tr"));
var rowCount = 0;
foreach (var row in rows)
{
if (rowCount > 0)
{
var columns = row.FindElements(By.TagName("td"));
columns[1].Click(); //Where it expands the new table
Thread.Sleep(2000);
WebDriverWait wait = new WebDriverWait(Driver.Instance, new TimeSpan(10));
var testTable = row.FindElement(By.TagName("table"));
var testRows = testTable.FindElements(By.TagName("tr"));
foreach (var testRow in testRows)
{
//trying to get the second table
var testColumns = testRow.FindElements(By.TagName("td"));
}