Created
August 20, 2020 10:45
-
-
Save angelovstanton/a1ddc6f68ce035ea6a8c363f2c137c2c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void setHiddenField() { | |
//<input type="hidden" name="country" value="Bulgaria"/> | |
var theHiddenElem = driver.findElement(By.name("country")); | |
JavascriptExecutor javascriptExecutor = (JavascriptExecutor) driver; | |
javascriptExecutor.executeScript("arguments[0].value='Germany';", theHiddenElem); | |
String hiddenFieldValue = theHiddenElem.getAttribute("value"); | |
Assert.assertEquals("Germany", hiddenFieldValue); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment