I have an online Web Application where there is a product listed which have a View button. On clicking the View button an alert is shown. The Alert have four (4) fields as: Alert Text, An Input Text field, OK button & Cancel button. The Alert text reads as "The Alert Text is :Product is out of Stock ! Please enter your Email Id".
If I Cancel the alert with my Selenium Java code, it works well:
//Switch to the Alert & Dismiss
driver.switchTo().alert().dismiss();
If I simply click OK with my Selenium Java code, it does works well:
//Click on Accept
driver.switchTo().alert().accept();
But if I try to provide my email id in the Input Text field on the Alert,
Thread.sleep(3000);
driver.switchTo().alert().sendKeys("debanjan.selenium@mymail.com");
//driver.switchTo().alert().sendKeys("debanjan");
//Click on Accept
driver.switchTo().alert().accept();
Selenium is showing org.openqa.selenium.WebDriverException as follows:
The Alert Text is :Product is out of Stock ! Please enter your Email Id org.openqa.selenium.WebDriverException: Missing 'value' parameter (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 6 milliseconds
OS Details: 'Windows 8' pro, os.arch: 'amd64', os.version: '6.2',
Java.version: '1.8.0_77'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Can anyone help me out please?
The weird thing is that: When I try through standalone Selenium Java Class to handle the Alert (i.e. passing the emailID in the Alert Text Box) this piece of code works fine.
driver.switchTo().alert().sendKeys("debanjan.selenium@gmail.com");
But when the same code is implemented through a FRAMEWORK (which I implemented) [Class : PlaceOrder, Method : orderCamera()], the emailID is never written in the Textbox field of the Alert.