This is a migrated thread and some comments may be shown as answers.

Databound Login Test

5 Answers 62 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 28 Mar 2011, 12:03 PM
As part of our evaluation I have created a data-bound login test, which I later plan to include as a step in other tests.

The first login works, but when the second iteration begins it fails as the web page is still logged. 

I have include a "clear browser cookie" and "execution delay" step at the beginning of the test but it appears to do nothing.

It is an ASP.NET application with forms authentication (using cookies) that is being tested.

Any suggestion to help debug this problem?

As a side question: will I be able to include this test "as a step" in other tests that are bound to a different data-source or do I need to create one single spreadsheet?


5 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 28 Mar 2011, 06:40 PM
Hello Ryan,

First check out this KB article. It might be exactly what you're looking for.

In your test script, are you logging out at the end of the test? For your specific problem you might be needing to close and reopen the browser in order for the logoff to be realized. You can do this in a coded step with these two lines of code:

ActiveBrowser.Close();
Manager.LaunchNewBrowser();

For data binding in general there are two possible approaches that the tool supports:

1) A subtest is databound to its own data source. The subtest will execute all rows of its datasource before returning to the parent test
2) The subtest inherits data from the parent test. When setup this way the subtest will execute just once for the current row of data before returning to the parent test.

Which approach to use is completely up to you. It all depends on how you wish to architect your tests.

Kind regards,
Cody
the Telerik team
0
Ryan
Top achievements
Rank 1
answered on 29 Mar 2011, 11:45 AM
Is there any way of close and reopening the browser AND keeping the debugger attached?

I have to close the browser at the start of the tests so that each iteration logs in correctly - I cant put the logout at the end of the test as its used as a step in other tests.

However whilst developing the test, I lose the debugger controls and ability to single step/breakpoints etc... because they seem to be lost when the new browser is opened at start.

Any guidance?
0
Cody
Telerik team
answered on 29 Mar 2011, 06:17 PM
Hello Ryan,

No I am sorry but that is a limitation in our current design. Our Visual Debugger will only work with the first initially opened browser that the framework automatically opens. It doesn't work with any subsequent popups or manually opened browsers.

Maybe you can work with your developers to figure out how to always be in logged off state when the browser first opens.

All the best,
Cody
the Telerik team
0
Ryan
Top achievements
Rank 1
answered on 30 Mar 2011, 10:20 AM
The browser *is* in a logged off state when first opened, its the second iteration (data bound test) that causes the problem, even though we make a call to clear the cookies at the beginning of the test. I unsure that the session cookies are being removed successful from the open browser window. If they where the very next request to the website would be redirected to the logon page - which its not.
Real show stopper for us...
0
Cody
Telerik team
answered on 30 Mar 2011, 10:28 PM
Hi Ryan,

I think I have a solution for you. With just one more line of code we can make the browser recycle happen on subsequent iterations, not the first iteration. Try this code and see if it does what you want:

if (0 != Data.IterationIndex)
{
    ActiveBrowser.Close();
    Manager.LaunchNewBrowser();
}

Kind regards,
Cody
the Telerik team
Tags
General Discussions
Asked by
Ryan
Top achievements
Rank 1
Answers by
Cody
Telerik team
Ryan
Top achievements
Rank 1
Share this question
or