Reputation: 312
I am running my selenium scripts on Selenium Grid, and I stumble into this error:
Result Message:
Test method AutFramework1.Tests.Smoke.RunTest threw exception:
System.UnauthorizedAccessException: Access to the path 'C:\Users\documents\visual studio 2013\Projects\AutFramework1\AutFramework\Config\SEL_ADAccountReactivate.xml' is denied.
Result StackTrace:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)
at System.Xml.XmlWriterSettings.CreateWriter(String outputFileName)
at System.Xml.XmlWriter.Create(String outputFileName, XmlWriterSettings settings)
at System.Xml.Linq.XDocument.Save(String fileName, SaveOptions options)
at System.Xml.Linq.XDocument.Save(String fileName)
at AutFramework1.Helpers.ReportSample.InsertValues(String ID, String Screenshot, String Step, String Result, String Comment) in c:\Users\Documents\Visual Studio 2013\Projects\AutFramework1\AutFramework\Helpers\ReportSample.cs:line 63
I have written a c# to write all the results to this xml file and it won't let me do it. I have already adjusted my file security settings. I am now not sure what to do with this, do I need to do something with my code? Thanks
Upvotes: 1
Views: 1418
Reputation: 312
Had to check proc explorer and there is something that holds on to my file. Issue is resolved. Thanks guys for the inputs
Upvotes: 1