Note that there are some explanatory texts on larger screens.

plurals
  1. POC#: Using Watin.Core with another user (ProcessStartInfo), IIS returns not authorized
    primarykey
    data
    text
    <p>My situation:</p> <p>I'm running a C# testing program which allows me to configure certain browser "steps", like going to an URL or clicking on a button. There's also the posibility to enter a domain, username and password. When running the program it will invoke another program* with the (if entered) username and password. This new program will run Internet Explorer (through Watin) and perform the "steps". </p> <p>The problem here is that when I go to a URL which requires a certain user, it will give me "You are not authorized to view this page". When I manually (Internet Explorer - Run As) login with the same user (and i checked the credentials more than once) it will give me authorization just fine.</p> <p>Something I allready tested: when running a localhost page (which would display the current user) I get authorization both manually and automatically through the program. <strong>Oh and: the program runs fine when I do not configure the credentials</strong> (it will skip the if statement)</p> <p>The code I use to launch the second program:</p> <pre><code>System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(); if (!string.IsNullOrEmpty(Username)) { System.Security.SecureString secPw = new System.Security.SecureString(); foreach (char c in Password) { secPw.AppendChar(c); } psi.UserName = Username; psi.Password = secPw; psi.Domain = Domain; } psi.WorkingDirectory = "c:\\temp"; psi.FileName = Path.Combine("c:\\temp", fileName); psi.Arguments = xmlStepFilename; psi.UseShellExecute = false; psi.EnvironmentVariables["TMP"] = "c:\\temp"; var process = new System.Diagnostics.Process(); process.StartInfo = psi; process.Start(); </code></pre> <p>Thank you for your time!</p> <p>(* The new program was implemented, because Internet explorer would always run under the user the initial application was started with, and it didn't seem possible to run Internet Explorer with another username/password because Watin did not support this... But that is not part of the problem)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload