Here is our test cases that we are trying to create. We are unable to login to the main page to do a validation however.
<testcases repeat="1">
<case
id="1"
description1="Login page"
url="
https://website.com/login.aspx"
verifypositive="Login"
parseresponse1='__VIEWSTATE" value="|"|escape'
parseresponse2='__VIEWSTATEGENERATOR" value="|"|escape'
parseresponse3='__EVENTVALIDATION" value="|"|escape'
/>
<case
id="2"
description="Sign in"
logrequest="yes"
method="post"
url="
https://website.com/login.aspx"
postbody="ctl00$content$userNameTextBox=s.user&ctl00$content$passwordTextBox=somepass&__VIEWSTATE={PARSEDRESULT1}&__VIEWSTATEGENERATOR={PARSEDRESULT2}&__EVENTVALIDATION={PARSEDRESULT3}&ctl00$content$logOnButton=Log%20In"
verifypositive="login page title"
/>
</testcases>
Below is what the login page form looks like. Can you help with the above syntax?
We have strange variables that have $ in them and we have values with spaces is this a problem.
The first case passes and grabs the variables we need, the second case only passes when we have content that only exists on the login page which is what happens when authentication fails.
<input type="hidden" name="__LASTFOCUS" id="__LASTFOCUS" value="" />
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="FCqv=" />
<input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="90A98831" />
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="gmLn/tvDDe3+c1n1ET+OdBem3cIg3NHHQ==" />
<input name="ctl00$content$offsetMinutesHidden" type="hidden" id="offsetMinutesHidden" />
<input name="ctl00$content$userNameTextBox" type="text" id="ctl00_content_userNameTextBox" tabindex="1" class="textField first fixPlaceholder" autocomplete="off" placeholder="Username" title="Username" onfocus="SelectAllText('ctl00_content_userNameTextBox');" />
<input name="ctl00$content$passwordTextBox" type="password" id="ctl00_content_passwordTextBox" tabindex="2" class="textField last fixPlaceholder" autocomplete="off" placeholder="Password" title="Password" onfocus="SelectAllText('ctl00_content_passwordTextBox');" />
<input id="ctl00_content_rememberMeCheckBox" type="checkbox" name="ctl00$content$rememberMeCheckBox" tabindex="3" /><label for="ctl00_content_rememberMeCheckBox">Save my login information</label>
<input type="submit" name="ctl00$content$logOnButton" value="Log in" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$content$logOnButton", "", true, "loginControl", "", false, false))" id="ctl00_content_logOnButton" tabindex="4" class="LoginButton" />