I am facing a problem that I cannot seem to solve. Despite searching for answers on Google and attempting different methods, I have been unsuccessful.
Here is the issue:
While testing a login page, I enter my login credentials, click the "login" button, and successfully log in. However, before the actual login process (after clicking the "login" button), there should be a prompt with some information and an "OK" button appearing. This prompt is triggered by an onclick() event of the "login" button. I am puzzled as to why the prompt does not show up, and I really need it to work properly (I am also facing a similar issue with a prompt asking "Do you want to save changes," which also fails to appear - I suspect that selenium.click(..,..) and webelement.click() might be somehow bypassing the onclick() events. Do you have any suggestions on how to make sure the onclick() events are functioning correctly? I am using Internet Explorer and Selenium WebDriver for this task.
Ps.: When I perform the same actions manually, the prompts do appear, so I don't believe it is an error in the JavaScript code.
Ps2.: Please help me, I have been trying to resolve this issue for 5 hours now...:(
Button Code:
<input id="loginForm:loginCmdTest" type="submit" onclick="showAlertAndSubmitForm ();clear_loginForm();" value="Login" name="loginForm:loginCmdTest">
Java Code:
selenium.type("id=loginForm:login", login);
selenium.type("id=loginForm:pass", pass);
selenium.click("id=loginForm:loginCmdTest");
Ps.3: Anyone?? Any ideas?