Friday, June 4, 2010

OTA - Download Manual Test Case

QC being one of the widely used tool in Test Management, upload/download test cases into QC is a part of Tester daily routine.

There are multiple ways to create a Test case in QC:
Add manual test cases in Test Plan
Upload Test cases from MS Excel using QTP-Excel Add-in
Upload Test cases from custom file into QC using OTA

Similarly during project migration, archiving test cases is very critical, which can be accomplished in multiple ways:
Using QC project archive tool
Download one test cases at a time by using the Save-As feature
Create a HTML report of all test cases within a folder
Use OTA to write a plug in to download the test cases within folder or set of folder

Below is the sample usage of the last option described above.
The script is written based on QC-API OTA, which exposes the features of QTP and everything done manually on UI of QC can be accomplished through OTA.

A very powerful tool in the hands of Automation tester with an inclination towards simplifying things by getting hands a bit dirty

PS : An article on OTA is due, so look out there for more information on OTA

'*************************************************************************' ' DownLoad Tests From QC and Store in Local Disk. Specify the folder path in QC Test Plan and the local disk path where the scripts needs to be stored
'26/01/07

'**************************************************************************

'Code to redirect the error into file is missing

Dim td
Dim tstMgr 'As TestManager
Dim tsttr 'As TestPlan Folder
Dim tsetFact 'As TestSetFactory
Dim tsetList 'As List

On Error Resume Next

'Create TD/QC Object and Connect and Login to the same

Set td=createobject("TDApiOle80.TDConnection.1")
td.InitConnectionEx "http://QC address"
td.ConnectProjectEx "Domain", "Project", "UserId", "Pwd"

If QCUtil.IsConnected Then

Set tstMgr = td.TreeManager

' Specify the Folder path of the tests that should be downloaded.

Set tsttr = tstMgr.NodeByPath("Subject\Application Product Test")
Set tsetFact = tsttr.TestFactory
Set tsetList = tsetFact.NewList("")

' Specify the Folder path of the tests where the scripts should be downloaded.
localTstPath = "C:\BackUp"

' Specify the test case that needs to be downloaded to the local disk
strTest = Inputbox("Enter test case name")

For Each tset in tsetList

tstName = tset.Name
If strTest = tstName Then
localTstPath = localTstPath & "\" & tstName
Set ext = tset.ExtendedStorage
ext.ClientPath = localTstPath
ext.ServerPath = tset.FullPath
ext.Load "-r *.*", True
Exit For
End If

' Specify the Folder path of the tests where the scripts should be downloaded.

localTstPath = "C:\BackUp"

Next

End If
************************************************************************
' Served the purpose? Share your feedback
** Happy Automating **

30 comments:

summi said...

Hi,

Thanks for the code. But I am facing few issues,
1.tset.Fullpath is giving empty strings. Is this valid?
2. ext.Load giving error as "CPRojectRepository::DoLoad:The path" must be absolute with either the server or drive specified.

Can you please help me on this..

Regards,
Suman Ch

Jonty... said...

Pls check the full path.
Try for some root folder and see the enumeration happens.

Anonymous said...

I do bеlieve all of thе ideas уou have offerеd
οn your post. They аrе very conνіncing аnd
can certaіnly work. Stіll, thе posts аre toо brief
fог nеωbies. May just you pleаse pгоlong them
a bit frоm subsequent time? Thank уou for the poѕt.


Alsο visit my blog ρost; BlackChipPoker Promotions

Anonymous said...

Hi, after reading this amazing article i am as well delighted to
share my experience here with friends.

Feel free to surf to my weblog ... this link

Anonymous said...

It's enormous that you are getting ideas from this post as well as from our discussion made here.

Also visit my webpage :: important source

Anonymous said...

This site definitely has all of the information I wanted about
this subject and didn't know who to ask.

Here is my weblog; Visit This Link

Anonymous said...

Hi there mates, how is everything, and what you desire to
say about this post, in my view its in fact awesome designed for me.


Also visit my web blog - click to find out more

Anonymous said...

This design is steller! You certainly know
how to keep a reader amused. Between your wit and your videos, I was almost moved to start
my own blog (well, almost...HaHa!) Fantastic job.
I really loved what you had to say, and more than that, how you presented it.
Too cool!

Visit my weblog; additional info

Anonymous said...

Hello, yeah this post is genuinely fastidious and I
have learned lot of things from it regarding blogging.
thanks.

Feel free to surf to my web site: buyiraqidinars1.wordpress.com

Anonymous said...

With havin so much written content do you ever run into any problems of plagorism or copyright violation?
My site has a lot of unique content I've either created myself or outsourced but it looks like a lot of it is popping it up all over the internet without my agreement. Do you know any ways to help prevent content from being stolen? I'd really appreciate it.


Also visit my blog; americancowboy.com

Anonymous said...

Wonderful beat ! I wish to apprentice while you amend your website, how can i subscribe for a weblog web site?
The account aided me a appropriate deal. I have been a little bit acquainted of this your broadcast offered bright
clear concept

Review my blog post; this website

Anonymous said...

Please let me know if you're looking for a article author for your blog. You have some really good posts and I believe I would be a good asset. If you ever want to take some of the load off, I'd absolutely love to write some articles for your blog in exchange for
a link back to mine. Please send me an email if interested.
Thank you!

Feel free to visit my web site ... this content

Anonymous said...

This website was... how do I say it? Relevant!! Finally I've found something that helped me. Thanks a lot!

Also visit my webpage :: see here

Anonymous said...

I absolutely love your blog and find most of your post's to be exactly I'm looking
for. Do you offer guest writers to write content available for you?

I wouldn't mind publishing a post or elaborating on a number of the subjects you write in relation to here. Again, awesome site!

Here is my homepage - my review here

Anonymous said...

Hi there, just wanted to say, I enjoyed this post.
It was practical. Keep on posting!

My homepage :: special info

Anonymous said...

It's a pity you don't have a donate button! I'd without a doubt donate to this superb blog! I guess for now i'll settle
for book-marking and adding your RSS feed to my Google account.
I look forward to fresh updates and will share this site
with my Facebook group. Chat soon!

Also visit my blog post :: sterlingcg.blogspirit.com

Anonymous said...

I blog frequently and I really thank you for your information.
This great article has really peaked my interest. I am going to book mark your website and keep checking for
new details about once per week. I opted in for your RSS feed too.


My homepage :: kennethblakemore.wikispaces.com

Anonymous said...

Excellent beat ! I would like to apprentice while you amend
your web site, how can i subscribe for a blog website? The account aided me a acceptable deal.
I had been tiny bit acquainted of this your broadcast provided bright clear idea

Here is my web site leelamont49.easyjournal.com

Anonymous said...

Spot on with this write-up, I actually think this web site needs far more attention.
I'll probably be back again to read through more, thanks for the info!

Look at my web page: safe diets

Anonymous said...

Please let me knoω if you're looking for a writer for your blog. You have some really good articles and I believe I would be a good asset. If you ever want to take some of the load off, I'd
love tο wгite ѕome artiсlеs foг your blog in exchange for a link bаcκ
tо mine. Please blast me an email if
interested. Kudos!

my ωеb blog - MintedPoker Bonus

Anonymous said...

Out of curiosity, what's roughly the percentage of electricity generated from solar wind jammer sources by 2020, up from Rs 200 crore this far. The Department of Energy wants the complex to exceed by 50 percent the standard for energy efficiency used as a basis for building codes nationwide. The" I think I can" and sheer determination overcame the greatest of obstacles.

Look into my web blog: renewable gold minecraft

Anonymous said...

Rhythm gig bag for jazzmaster players must master basic rhythm and picking patterns
before moving on to rhythms that may incorporate slides, hammer-ons, vibrato,
etc, and where to use capos.

Feel free to visit my site :: Go to This site

Anonymous said...

Ӏt's an amazing article designed for all the internet visitors; they will take advantage from it I am sure.

My web site ... MintedPoker Bonus []

Anonymous said...

The dilemma is how to build without disturbing any antiquities that may lie buried
and undiscovered below its spectacular roads and streets.
This diet has you eating as much meat and
eggs as you can to increase the body's metabolism.
Place your feet flat on the floor with your hands on your thighs.


My web site subway surf hack

Anonymous said...

Cheap Chanel Sale
Everyone loves what you guys tend to be up too.

This type of clever work and exposure! Keep up the terrific works guys I've
included you guys to our blogroll.

Anonymous said...

Very good information. Lucky me I came across your site by accident (stumbleupon).
I've book-marked it for later!

Here is my weblog; how to hack facebook account with phishing part 2

Anonymous said...

prada 2014
Hello, I log on to your new stuff daily.
Your humoristic style is witty, keep it up!

Anonymous said...

prada handbags 2013
Hello would you mind sharing which blog platform you're using?
I'm planning to start my own blog in the near future but I'm
having a tough time choosing between BlogEngine/Wordpress/B2evolution and Drupal.
The reason I ask is because your design seems
different then most blogs and I'm looking for something completely unique.

P.S Apologies for getting off-topic but I had to ask!

Anonymous said...

Nice post. I was checking constantly this weblog and I am impressed!

Extremely useful info specifically the ultimate phase :) I care for such
info much. I was seeking this particular information for
a very long time. Thank you and good luck.

Here is my homepage :: how to watch tv channels online for free

Sherlin Jones said...

Manual testing is a testing process that is carried out manually in order to find defects without the usage of tools or automation scripting.A test plan document is prepared that acts as a guide to the testing process in order to have the complete test coverage.

Having knowledge in automation test cases like selenium will helps to get placed in top MNC companies. Here is something more about Selenium. Selenium Training in Chennai

If you are a beginner then here is the solution for you Free Selenium Tutorials for beginners