尝试以下选项来水平滚动:// scroll at a particular elementWebElement e1 =driver.findElement(By.xpath(“//input [@id=’ElementID’]”));((JavascriptExecutor)driver).executeScript(“arguments[0].scrollIntoView();”, e1);Where ‘e1’ is the locator where you want to scroll.// scroll at a particular coordinate,. ((JavascriptExecutor)driver).executeScript(“window.scrollBy(200,300)”);// scroll horizontally in the right direction.((JavascriptExecutor)driver).executeScript(“window.scrollBy(2000,0)”);// scroll horizontally in the left direction.((JavascriptExecutor)driver).executeScript(“window.scrollBy(-2000,0)”);