1

I'm writing some automated tests in C# and a JavaScript error is thrown when I try to click on a button that will submit changes made to a web form. The error I am recieving is:

An error has occured in the script on this page 
Line:  2004 
Char:  9 
Error:  Permission denied 
Code:  0 
URL:  file:///C:/DOCUME~1/nkinney/LOCALS~1/Temp/customProfileDir6c0c7d7226cc463fb­b1a7f6253c4df62/core/scripts/selenium-browserbot.js 

Once the test is finished, the error will still be displayed if I manually click on the button while selenium is running.

The line in selenium to select this button is:

selenium.Click("//input[contains(@id, 'SubmitBtn')]"); 

I've also tried submit.

A pop-up should be displayed asking the user to confirm they want to make the changes. This error is thrown before the pop-up is displayed and after Selenium 'clicks' on the button.

Any advise would be greatly appreciated.

Petr Janeček
  • 37,768
  • 12
  • 121
  • 145
Nick
  • 11
  • 2
  • I should also point out the browser opens a moto window. I think this may be the issue, but I'm unsure of what I need to do in order to work around it. – Nick Mar 04 '10 at 22:12
  • When you click submit is the test moving to another domain? – AutomatedTester Mar 05 '10 at 12:00
  • No, it is not. I need to make changes fo some fields on the page, then I get a modal window me to confirm I want to make the changes after i click on a sudmit button. The problem is I get this java script error after selemiun clicks on the button. I know it is clicking on the button as the entire id is displayed in the selenium server window. – Nick Mar 05 '10 at 14:50
  • Is there any update regarding this issue ? I am still facing the same problem – Rakesh Prabhakaran Jul 06 '11 at 06:30
  • Have you tried to loosen the internet security settings on the test-machine? It may help. – marsbear Jul 12 '11 at 09:21

2 Answers2

0

After further investigation, I found that Selenium is unable to work with custom modal dialog boxes. That said, I don't think I will be able to use Selenium to automate UI testing in our current release. Thanks to anyone who looked at this post.

Nick
  • 11
  • 2
0

From the Selenium FAQ

I can't interact with a popup dialog. My test stops in its tracks!

You can, but only if the dialog is an alert or confirmation dialog. Other special dialogs can't be dismissed by javascript, and thus currently cannot be interacted with. These include the "Save File", "Remember this Password" (Firefox), and modal (IE) dialogs. When they appear, Selenium can only wring its hands in despair.

To solve this issue, you may use a workaround (if one exists); otherwise you may have to exclude the test from your automated corpus. For the "Save File" dialog in Firefox, a custom template may be specified when running via the RC that will always cause the file to be downloaded to a specified location, without querying the user (see http://forums.openqa.org/thread.jspa?messageID=31350). The "Remember this Password" dialog should not appear again after you've chosen to remember it. Currently there is not much that can be done about IE modal dialogs.

Do you have the option of seeing if the test runs in another browser (Firefox, Chrome)?

A very similar answer is also here: How do I test modal dialogs with Selenium?

Community
  • 1
  • 1
Ryan Guest
  • 6,080
  • 2
  • 33
  • 39