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

[Solved] How to retain browser state between steps

8 Answers 75 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
JoshKorn
Top achievements
Rank 1
JoshKorn asked on 17 Jun 2009, 11:09 AM
I want to replicate the exact behaviour that's shown in this ArtOfTest video:
   http://www.artoftest.com/community/Advanced-Features/Test-Reuse.aspx

However, when I do the exact same thing, I get a fresh browser for each step, and of course, all the steps after the first one, fail.

Why would that be?

Thanks
Josh

8 Answers, 1 is accepted

Sort by
0
Missing User
answered on 17 Jun 2009, 03:30 PM
Hi Josh,

believe I understand what you are seeing, but just to be clear, you are using two different tests against the same page, right? And when one test is used as a step for the other the test, the test page is automatically refreshed?

If this is the case, we will look into fixing this for a future release of the the product. In the mean time, if you could please seperate your tests to run against different pages so that information won't be lost when using tests as steps.

Regards,
Nelson Sin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
JoshKorn
Top achievements
Rank 1
answered on 17 Jun 2009, 04:05 PM
Nelson:

>> I believe I understand what you are seeing, but just to be clear, you are using two different tests against the same page, right?

No.That's definitely not what's happening.

I am running the exact same scenario as the video shows, but it's not working -- the first step (login) succeeds, but subsequent steps fail. As in the video, the test starts at a login page; when you enter a userid/password and click a Login button, you go to a different page.

When I run a test containing [step1-Login, step2-Do Something else, step3-Logout] -- or even when I run the Login test in isolation, it's plain to see that at the end of each step, the browser instance is closed and therefore continuity is lost.

I've double-checked each step's properties, and on each, the ClosesBrowser attribute is set to False.
I'm running IE8 in compatibility mode (although it doesn't seem to have any impact on the problem).

Judging from the video, it looks like the browser should not be closed at the end of each step.

Still mystified... still stuck, too 8-(

Josh


0
JoshKorn
Top achievements
Rank 1
answered on 17 Jun 2009, 08:22 PM
Nelson:

I found this item on one of the ArtOfTest forums: http://www.artoftest.com/community/forums/webaii--web-automation-infrastructure/forum-general-questions/how-to-turn-off-the-automatic-action-of-closing-browser.aspx#6518

It looks like there may be a deeper problem than I thought. The above post refers to a (Shared Manager) template, where the test is derived from BaseVsUnitTestSharedManager instead of BaseVsUnitTest. And if I preview the code of any of the test steps I constructed, the first line is "Manager.LaunchNewBrowser()".

The (Shared Manager) template is installed

Correct me if I'm wrong, but if I want to replicate what's in the video, I have to convert all the test steps to code, then cut and paste the various pieces into the Shared Manager template. Effectively, this means that any time a tester wants to change a test step, they have to come to me, no?

Josh
0
Missing User
answered on 17 Jun 2009, 08:22 PM
Hello again Josh,

Sorry about the confusion, I thought browser refresh instead of a new browser being launched after a step is executed. So running the Login Test individually launches a new browser after each step and thus fails the test? But then using it as a step in another test runs the Login Test in only one browser instance, closes the browser afterwards, another browser is launched and subsequent steps fail since the browser is logged out?

So is this behavior occurring when your test is played back in Firefox as well as IE? Also, is a new browser launched after each step in a simple test that doesn't require a login, say like navigating to Google, then googling some text?

And could you please post the test execution log? After running the test, you can bring the log up via the test result bar that pops out when the test is complete in the Test Explorer Window. The bar has the number of steps that passed next to a red 'X'. To the right of that is the icon that looks like a piece of paper with the tool tip 'View test log'

Regards,
Nelson Sin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
JoshKorn
Top achievements
Rank 1
answered on 17 Jun 2009, 10:06 PM
Nelson:

>> could you please post the test execution log?

I don't have it with me right now, but I can post it tomorrow.

>> So is this behavior occurring when your test is played back in Firefox as well as IE?

Yes.

>> Also, is a new browser launched after each step in a simple test that doesn't require a login,
>> say like navigating to Google, then googling some text?

Yes. "Every step" means precisely "every step".

Josh

BTW, simple tests aren't particularly helpful to me, since the app I'm testing has over 300k lines, and always requires a login.
0
Missing User
answered on 19 Jun 2009, 04:44 PM
Hello Josh,

Just wanted to get back to you on this issue and I learned that you were able to find a solution to this in the Art Of Test forums. So I'll just post a link to your findings here to help anybody else who may encounter this problem and, if you have a chance, please post back with any other information you think would also be helpful. 

Greetings,
Nelson Sin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
JoshKorn
Top achievements
Rank 1
answered on 22 Jun 2009, 01:59 PM
Nelson:

I ended up installing just the vanilla ArtOfTest trial, to see if it produced different results than the Telerik build.

Since login/logout scenarios are so common, one thing I'd suggest is an example that illustrates what's in the ArtOfTest video (e.g. logging into the Telerik site, going to the forums page and accessing "My Posts", and logging out). That way, anyone can easily verify that the basic parts of testing (continuity of browser, composition of test from fragments) work cleanly.

Regards
Josh

p.s. It's still not clear to me whether WebUI Test Studio is different in any way from the ArtOfTest distribution (except for the addition of the Telerik control translators). It would definitely help to know if it is or isn't.
0
Missing User
answered on 23 Jun 2009, 10:45 PM
Hi again Josh,

Thanks for bringing this up, we will look to re-test this and other base cases against the current WebUI Test Studio build for any possible regressions.

To answer your last question, the Telerik Translators are the major difference between the versions, and if you do use Telerik controls extensively, we advise you use WebUI. That way, you will have full and easy automation testing ability over all Telerik controls without writing complicated test scripts, and the support of both Telerik and Art Of Test for any issues you may encounter.

Best wishes,
Nelson Sin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
JoshKorn
Top achievements
Rank 1
Answers by
Missing User
JoshKorn
Top achievements
Rank 1
Share this question
or