I'm using the WatiN testing tool with Visual Studio 2005. When I try to select a value from my list box I am getting an "access denied" error.
相关问题
- How to know full paths to DLL's from .csproj f
- Importing NuGet references through a local project
- Visual Studio 2019 - error MSB8020: The build tool
- 'System.Threading.ThreadAbortException' in
- VS2017 RC - The following error occurred when tryi
相关文章
- How to show location of errors, references to memb
- How to track MongoDB requests from a console appli
- Visual Studio Hangs on Loading UI Library
- How to use Mercurial from Visual Studio 2010?
- Copy different file to output directory for releas
- Edit & Continue doesn't work
- “Csc.exe” exited with code -1073741819
- Visual Studio: Is there an incremental search for
This is a bug in the select list where if the list is not ready to accept input, and it can throw one several exception types. We solve it like this:
And yes I know that swallowing all exceptions like this is normally bad, but if the exception occurs again, it is thrown to the test code and the test fails.
I noticed this happens if you try and select a value that is already selected.
You can work around this with a pre-check:
or maybe use a try catch?
I have seen this a lot with select lists recently when using the WatiN 2.0 beta. Instead of using the aSelectList.Select(strText) option, it seems to work better when you do this:
This can also happen when changing an ASP.NET control that cause an auto-postback. The first change will register, but the next element you try to access will throw an "Access Denied" error because it is still trying to access the old page. In this case you can try using ie.WaitForComplete(), but sometimes this is required: