Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save twalpole/3889a5b39e9e5656397b7547c07d0d7b to your computer and use it in GitHub Desktop.
Save twalpole/3889a5b39e9e5656397b7547c07d0d7b to your computer and use it in GitHub Desktop.
[Test]
public void ClickLabelTest()
{
driver.Url = EnvironmentManager.Instance.UrlBuilder.CreateInlinePage(new InlinePage()
.WithBody(
"<div style='height: 2000px;'>Force scroll needed</div><label id='wrapper'>wraps a checkbox <input id='check' type='checkbox' checked='checked' style='display:none'/></label>"));
IWebElement label = driver.FindElement(By.Id("wrapper"));
label.Click();
IWebElement checkbox = driver.FindElement(By.Id("check"));
Assert.IsFalse(checkbox.Selected);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment