So I have a website that uses slick grid. basically when the browser window is maximized you still have horizontal scrollbar(this is by user design). Now in web automation test(using selenium) I do get total number of columns correct, but without scrolling to the right selenium only gives me column headers that are visible and the other columns that are not in visibility are returning blank or empty string. My question to you guys is have you had similar problem and how you got around this problem. This is my code so far. But it returns blank when slick grid has not loaded new contents without scrolling. I need to be able to somehow scroll to the right to get all the column headers.
int GetColumnIndexByName(string columnName)
{
VerifyComponentLoaded();
var colHeaders = Driver.FindElements(By.XPath("somepath"));
for (int i = 0; i < colHeaders.Count; i++)
{
if (colHeaders.ElementAt(i).Text == columnName)
return i;
}
Assert.Fail("The columnName {0} was not found.", columnName);
}