Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IWebElement clickUsername = driver.FindElement(By.XPath("//input[@name='tbUsername']"));
- clickUsername.Click();
- clickUsername.SendKeys("MyUsername");
- IWebElement clickPassword = driver.FindElement(By.XPath("//input[@name='tbPassword']"));
- clickPassword.Click();
- clickPassword.SendKeys("Mypassword");
- <div class="inputbg">
- THIS IS VISIBLE => <input id="dummypassword" class="input" type="text" onfocus="this.style.display='none';document.getElementById('pw').style.display='inline';document.getElementById('pw').focus()" value="Password" tabindex="2" name="dummypassword">
- THIS IS INVISIBLE => <input id="pw" class="input" type="password" onblur="if(this.value==''){this.style.display='none';document.getElementById('dummypassword').style.display='inline'}" onkeypress="if (event.keyCode==13)fmLogin.submit();" value="" style="display: none;" tabindex="2" name="tbPassword" autocomplete="off">
- </div>
- IWebElement clickPassword = driver.FindElement(By.Id("dummypassword"));
- clickPassword.Click();
- IWebElement realPasswordInput = driver.FindElement(By.XPath("//input[@name='tbPassword']"));
- realPasswordInput.SendKeys("Mypassword");
- allTextBoxes = driver.FindElements(By.Id("username"));
- var allPasswordTextBoxes = driver.FindElements(By.Id("password"));
- var userNameTextField = allTextBoxes.Count > 0 ? allTextBoxes[1] : allTextBoxes[0];
- userNameTextField.SendKeys("myUsername");
- var passwordTextField = allPasswordTextBoxes.Count > 0 ? allPasswordTextBoxes[1] : allPasswordTextBoxes[0];
- passwordTextField.SendKeys("myPassword");
Add Comment
Please, Sign In to add comment