Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can anyone give me some tips to automate tests?
#1
Not Solved
We have these requirements in our workplace... I just managed to learn to create tests individually and run them individually using QTP IDE (Run button).

Requirement 1:
I have 5 tests. I would like to have a script to run all of them in sequence. I am new to this testing domain.
Requirement 2:
Sometimes I might have to run one test so many times, every time let the test open a new browser window (should leave the earlier test browser window open). So if I ran the test 10 times, at the end, I will have 10 browser windows open.

Please give me some tips or share some info on how you do this?

Thanks for your time.
Reply
#2
Not Solved
Soln to REQ1:
You can use 'Test Batch Runner' to run several tests in succession. (Start->All Programs->QTP->Tools->Test Batch Runner.

From 'File' menu select 'New',Then from Batch menu select 'Add'.Now 'Open Test' dialog will open and you can add your 5 test to it.Svae it as .mtb file. Now you can run it(F5 or Batch ->Run) Make sure that in QTP tools->option->run tab 'allow other mercury product to..." check box is checked.

Using Test Batch Runner, you can set up a list of tests and save the list as an .mtb file, so that you can easily run the same batch of tests again, at another time. You can also choose to include or exclude a test in your batch list from running during a batch run.

Soln Req 2:
For this in tools->option->web tab -> 'Advance' option->check the 'browser cleanup' check box under the 'run seting'
Also you can close all the browser programetically after finishing your test steps.
Code:
(use systemutil.CloseDescendentProcesses() /systemutil.CloseProcessByWndTitle("Internet Explorer")


Also let me know if this meets you requirements.
Reply
#3
Not Solved
Thanks for the answer. I hit another issue.

Used the batch runner. As the first test updates/inserts values into the global data table to pass it between actions, I think the test becomes an unsaved one after it runs; then when test batch runner tries to go to the next test in the batch, it could not...saying "Unable to close unsaved test".
I checked test run settings.. etc. Is there any way, we can tell the test to save before closing after a run. Or is there any (script) programmatic way to do this.

For solution 2, we do not want to close the browser window after a test-run. In other words, simply open a new browser every time the test runs ignoring the existing browser windows.
Reply
#4
Not Solved
I used the batch runner and I mentioned the following issue:
As the first test updates/inserts values into the global data table to pass it between actions, I think the test becomes an unsaved one after it runs; then when test batch runner tries to go to the next test in the batch, it could not...saying "Unable to close unsaved test".
I checked test run settings.. etc. Is there any way, we can tell the test to save before closing after a run. Or is there any (script) programmatic way to do this.

I guess I was wrong. Probably I clicked something while the batch runner was running the test and it made the test to "unsaved" status.
Actually Batch Runner works great.

Then I asked about the following requirement:
"Sometimes I might have to run one test so many times, every time let the test open a new browser window (should leave the earlier test browser window open). So if I ran the test 10 times, at the end, I will have 10 browser windows open."
Papu wrote a solution:
Soln Req 2:
For this in tools->option->web tab -> 'Advance' option->check the 'browser cleanup' check box under the 'run seting'
Also you can close all the browser programetically after finishing your test steps.(use systemutil.CloseDescendentProcesses() /systemutil.CloseProcessByWndTitle("Internet Explorer")


Actually, the above solution is to close the browser window each time a test session is over. I do not want to close the browser window, and still want the test to use a fresh another one every time it runs, leaving the open window as it is. Is this possible? Like the load testing.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [UFT] Fixed web tests with dynamic parts jdd 3 2,663 04-05-2016, 02:56 PM
Last Post: vinod123
  This code does not give total no of links present on page plz help it returns 0 excellentpawan 8 5,717 01-17-2015, 07:49 PM
Last Post: yogi4tech
  Run Button is not available in QTP 11 - while running tests from QC 11 Kannan R 0 1,908 08-13-2013, 08:15 PM
Last Post: Kannan R
  cannot open QTP tests learnasugo 8 9,347 10-18-2012, 11:28 AM
Last Post: Ankesh
  Can i Give Variable in Object name ??? thiyaga 2 3,254 06-20-2012, 09:21 PM
Last Post: Surya

Forum Jump:


Users browsing this thread: 1 Guest(s)