diff --git a/cws-test/src/test/java/jpl/cws/test/integration/ui/SnippetsTestIT.java b/cws-test/src/test/java/jpl/cws/test/integration/ui/SnippetsTestIT.java index ef9d5600..10a28efd 100644 --- a/cws-test/src/test/java/jpl/cws/test/integration/ui/SnippetsTestIT.java +++ b/cws-test/src/test/java/jpl/cws/test/integration/ui/SnippetsTestIT.java @@ -160,7 +160,12 @@ public void runValidateButtonTest() { waitForElementID("validateAndSaveSnippetsSubmitBtn"); log.info("Clicking on 'Validate and Save' button."); - driver.findElement(By.id("validateAndSaveSnippetsSubmitBtn")).click(); + + WebElement validateAndSaveButton = driver.findElement(By.id("validateAndSaveSnippetsSubmitBtn")); + JavascriptExecutor js = (JavascriptExecutor) driver; + js.executeScript("arguments[0].scrollIntoViewIfNeeded();", validateAndSaveButton); + + validateAndSaveButton.click(); log.info("Verifying 'Saved the snippets' shows up on the page."); if(findOnPage("Saved the snippets")) { @@ -219,7 +224,11 @@ public void runUpdateSnippetTest() throws IOException { waitForElementID("validateAndSaveSnippetsSubmitBtn"); log.info("Clicking on 'Validate and Save' button..."); - driver.findElement(By.id("validateAndSaveSnippetsSubmitBtn")).click(); + + WebElement validateAndSaveButton = driver.findElement(By.id("validateAndSaveSnippetsSubmitBtn")); + js.executeScript("arguments[0].scrollIntoViewIfNeeded();", validateAndSaveButton); + + validateAndSaveButton.click(); log.info("Verifying 'Saved the snippets' shows up on the page."); if(findOnPage("Saved the snippets")) { @@ -255,7 +264,11 @@ public void runUpdateErrorTest() throws IOException { waitForElementID("validateAndSaveSnippetsSubmitBtn"); log.info("Clicking on 'Validate and Save' button"); - driver.findElement(By.id("validateAndSaveSnippetsSubmitBtn")).click(); + + WebElement validateAndSaveButton = driver.findElement(By.id("validateAndSaveSnippetsSubmitBtn")); + js.executeScript("arguments[0].scrollIntoViewIfNeeded();", validateAndSaveButton); + + validateAndSaveButton.click(); log.info("Looking for 'ERROR: invalid code.' on page."); if(findOnPage("ERROR: invalid code.")) { @@ -293,7 +306,11 @@ public void runReloadEditorTest() throws IOException { waitForElementID("validateAndSaveSnippetsSubmitBtn"); log.info("Clicking on 'Validate and Save' button"); - driver.findElement(By.id("validateAndSaveSnippetsSubmitBtn")).click(); + + WebElement validateAndSaveButton = driver.findElement(By.id("validateAndSaveSnippetsSubmitBtn")); + js.executeScript("arguments[0].scrollIntoViewIfNeeded();", validateAndSaveButton); + + validateAndSaveButton.click(); log.info("Looking for 'ERROR: invalid code.' on page."); if(findOnPage("ERROR: invalid code.")) {