WatiN UnauthorizedAccessException errors

廉价感情. 提交于 2019-12-06 12:18:04
prostynick

Try my answer to other question:

Try turning off IE's protected mode or add your site to trusted zone.

WatiN permissions problem when eval javascript code

It can happen when the HTML is not entirely loaded You can add Sleep or add the wait for complete command

ie.WaitForComlete();

The best way is to catch the specific exception and try it again:

     try
     {
         //your code
     }
     catch (UnauthorizedAccessException)
     {

     }

The solution for me was to uninstall the Trusteer Rapport browser security software that my bank offers. I had forgotten it was even installed.

I had the same problem at random positions in the test. I was already running in the trusted zone.

Adding a

System.Threading.Thread.Sleep(200);

at each problem location "solved" the problem or at least its symptoms for me. At least I do not get the error anymore and am able to run the tests.

It seems to be a race condition somewhere.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!