- saivikActive particpant
- Posts : 12
Join date : 2009-11-06
How to capture the messages shown by response.write() method
Thu Nov 26, 2009 3:35 pm
Hi,
how to capture the alert message that is shown via response.write()
My code snippet:
I am getting an alert after clicking on add button in the UI.
The alert is being generated from Response.Write()
So. my script is,
But, the log says, there were no alerts. The test is failing.
How to capture the alert generated from Response.Write()
Pls help with this.
-Saivik
how to capture the alert message that is shown via response.write()
My code snippet:
- Code:
if (Requestaction == "add")
{
strTemp = "<script language='javascript'>
alert('New Record successfully created and the Requisition number is " + strReqNumber + "');
</script>";
Response.Write(strTemp);
}
I am getting an alert after clicking on add button in the UI.
The alert is being generated from Response.Write()
So. my script is,
- Code:
selenium.chooseOkOnNextConfirmation();
selenium.click("btnAdd");
selenium.getAlert();
But, the log says, there were no alerts. The test is failing.
How to capture the alert generated from Response.Write()
Pls help with this.
-Saivik
Re: How to capture the messages shown by response.write() method
Wed Dec 02, 2009 11:33 am
hi,
First try to use storeAlert to know whether is there any alert present or not. After you getting all information than you proceed further to perform some operation on alert .
Because when u execute the code, some alert is occurring in background and handle at there only.
Best of luck.
Bye
First try to use storeAlert to know whether is there any alert present or not. After you getting all information than you proceed further to perform some operation on alert .
Because when u execute the code, some alert is occurring in background and handle at there only.
Best of luck.
Bye
- saivikActive particpant
- Posts : 12
Join date : 2009-11-06
Re: How to capture the messages shown by response.write() method
Wed Dec 02, 2009 2:35 pm
I tried using storeAlert, but it is failing and showing error msg as "There are no alerts".
Re: How to capture the messages shown by response.write() method
Wed Dec 02, 2009 9:32 pm
then don't use the command to handle the alert. just move on to test command.
It will be possible that alert appearing before and you handle it later or vice-versa.
It will be possible that alert appearing before and you handle it later or vice-versa.
- saivikActive particpant
- Posts : 12
Join date : 2009-11-06
Re: How to capture the messages shown by response.write() method
Thu Dec 03, 2009 2:39 pm
When that alert pops up, i cannot perform any actions like clicking logout button/link, accessing any other page...
until i click on 'OK' button in that alert popup. and i am not able to click on that 'OK' button through any of the commands.
until i click on 'OK' button in that alert popup. and i am not able to click on that 'OK' button through any of the commands.
Permissions in this forum:
You cannot reply to topics in this forum