You may have some alert in the login page to display some alert on invalid username and password. When you want to automate the test cases on those pages, you need to add some javascript code on those pages before displaying the alert or confirm. These following lines makes the selenium to capture the alert or confirm messages.
var browserbot = parent.selenium.browserbot;
if (browserbot) {
browserbot.modifyWindowToRecordPopUpDialogs(window, browserbot);
}
alert("Alert message after those selenium workaround js snippet");
7 comments:
where i have to put this code?
do i have to put this code in html page (into tag head)? and add the reference to selenium-browserbot.js in the tag head?
Add that code in the javascript anywhere before your alert code.
No need to reference selenium-browserbot.js
why cant i do a selenium.runscript with the java script?
if we don't have the opention to change the code,then what should we do
In our application we cannot make any changes in code.What to do in that case?
Please help...........its very urgent
Post a Comment