The code is:
WebElement element=driver.findElement(By.xpath("//div[@class='table-wrapper']"));
JavascriptExecutor js=(JavascriptExecutor)driver;
js.executeScript("arguments[0].scrollLeft=arguments[0].scrollWidth", element);
While debugging at third step, executeScript
returned me "null".
Xpath is correct and locating well. I can't able to find locator of scroll so I am using whole locator of that particular div. i.e //div[@class='table-wrapper']
.