I'm using Selenium
WebDriver
to enter text in 2 textboxe
using java. I am able to enter text in the 1st text box but for the 2nd textbox
I keep getting ElementNotVisibleException
HTML code..
<form name="form">
<div class="form-group">
<input name="name" type="text" class="form-control" ng-model="name" placeholder="Name*" required>
</div>
<div class="form-group">
<input name="email" id="email" type="email" class="form-control" ng-model="email" ng-change="(form.email.$dirty && form.email.$valid) ? error='' : error='Please enter a valid email'" placeholder="Email*" required autofocus/>
</div>
</form>
Java Code..
WebElement name = driver.findElement(By.name("name"));
name.sendKeys("Sample Name");
WebElement signup_email = driver.findElement(By.name("email"));
signup_email.sendKeys("[email protected]");
Error:
org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with Command duration or timeout: 19 milliseconds Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:32:46' System info: host: 'Hp-PC', ip: '172.16.255.131', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_79' Session ID: 2e7ab2fd-cd6b-428e-86e7-a4f7d8d737fa Driver info: org.openqa.selenium.firefox.FirefoxDriver Capabilities [{platform=WINDOWS, acceptSslCerts=true, javascriptEnabled=true, cssSelectorsEnabled=true, databaseEnabled=true, browserName=firefox, handlesAlerts=true, nativeEvents=false, webStorageEnabled=true, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=47.0.1}] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678) at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:327) at org.openqa.selenium.remote.RemoteWebElement.sendKeys(RemoteWebElement.java:122) at src.tests.EmailSignUp.test(EmailSignUp.java:107) at src.tests.EmailSignUp.main(EmailSignUp.java:27)
Edit 1:
In the Browser Console the following classes are being automatically being populated by angular Js
I can't understand where I'm going wrong in case of 2nd textbox
. Is the angular code causing problems?? Please Help..