How to scroll the horizontal bar in a grid using selenium. This should be repeated in multiple selections. I have to select the value and click submit. I have to check all the column headers. But, there are 46 columns. Please help. I am unable to move it.
List<WebElement> gridlabellist = driver.findElements(By.xpath(".//*[@id='gview_list']/div[3]/div/table/thead/tr/th"));
List<String> all_gridlabellist=new ArrayList<>();
Thread.sleep(1000);
int gl;
System.out.println(gridlabellist.size());
for(gl=0; gl<gridlabellist.size(); gl++)
{
String gridlabelname=gridlabellist.get(gl).getText();
boolean dislabel=gridlabellist.get(gl).isEnabled();
//System.out.println(labelname);
if((gridlabelname != null) && (gridlabelname.length()!=0) && dislabel)
{
System.out.println("\nGrid Label Names displayed: " + gridlabelname);
((JavascriptExecutor)driver).executeScript("window.scrollBy(2000,0)");
System.out.println("\nGrid Label Names displayed: " +gridlabelname);
}
all_gridlabellist.add(gridlabellist.get(gl).getText());
}
