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

Recording of Closing and Opening browser

2 Answers 215 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ravi Prakash
Top achievements
Rank 1
Ravi Prakash asked on 09 Apr 2012, 06:25 PM
Hi,

I am recording a scenario for an intranet application which uses the windows authentication and doesn't have login page. When I record for the regular user role scenario and then separately record for his/her supervisor role, the tests record and execute as expected.
But if I try to record complete scenario into one test of opening the browser with regular user and performing certain actions and then closing the browser to login as supervisor, doesn't work, as TS understands the close of browser as end of test and doesn't take recordings for Supervisor role.
So, I recorded them separately and then copy+pasted them to one single test. Now, executing would not close the browser after first login and fails while trying to key in the credentials of the supervisor.
Hand coding to add  ActiveBrowser.Close(); helped in closing the browser forcibly, but not able to manage how to open the browser for next login.

Any straight settings or work-arounds?

Thanks,
Ravi

2 Answers, 1 is accepted

Sort by
0
Accepted
Anthony
Telerik team
answered on 10 Apr 2012, 04:08 PM
Hello Ravi,

My first question is why are you trying to combine two separate scenarios into one test? It is our opinion that tests are best kept as modular as possible and that you don't try to accomplish too much into one test.

What you're experiencing is expected behavior as Test Studio will automatically open and close the browser, and you shouldn't be implementing that manually. A work-around would be to open a new browser window in code after closing the previous window:

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

It's better to keep the tests separate and add them both to a test list. When you execute the Test List with the RecycleBrowser Test List Setting set to False, the browser will close and open between each test.

Regards,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Ravi Prakash
Top achievements
Rank 1
answered on 11 Apr 2012, 04:21 PM
Hi Antony,

Thanks. That solved the issue.
Not sure, if I can convince you on my scenario. Let me try! The scenario involves certain activity of saving a record by normal user, to be approved by his/her supervisor user (higher level role user). As mentioned earlier, application doesn't include the login screen, but validates on the Windows login authentication. What we are trying to achieve is, verifying the record is available after approval (which will be part of next activities by normal user). As mentioned by you, this could be achieved by using the Test list and worked well for me. But, I consider to merge to one test, as the ID generated needs to be used for tracking throughout and is the only identifier. Just having a test of Supervisor approving alone is needed in between.
I agree with you on keeping as modular as possible, but wanted to keep little number of tests, as these whole set works as pre-requisite for my further verification tests.

Thanks again,
Ravi
Tags
General Discussions
Asked by
Ravi Prakash
Top achievements
Rank 1
Answers by
Anthony
Telerik team
Ravi Prakash
Top achievements
Rank 1
Share this question
or