Created
February 28, 2016 19:12
-
-
Save angelovstanton/90e13fca3caba0e0530a to your computer and use it in GitHub Desktop.
This file contains 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
[TestMethod] | |
public void SetHiddenField() | |
{ | |
////<input type="hidden" name="country" value="Bulgaria"/> | |
IWebElement theHiddenElem = driver.FindElement(By.Name("country")); | |
string hiddenFieldValue = theHiddenElem.GetAttribute("value"); | |
Assert.AreEqual("Bulgaria", hiddenFieldValue); | |
((IJavaScriptExecutor)driver).ExecuteScript( | |
"arguments[0].value='Germany';", | |
theHiddenElem); | |
hiddenFieldValue = theHiddenElem.GetAttribute("value"); | |
Assert.AreEqual("Germany", hiddenFieldValue); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment