I can not find the QTP category to post this in....  so I am posting this in SAP and other

I am setting up some testing in QTP (HP QuickTest Pro / HP Quality Center). I made edits to the default.xls so that my datatables have the most current copy of the test plan so I do not have to import anything... and when the file opens in QTP it is all there.  Now as I perform the code in the test, it populates a Pass/Fail parameter for each line item of the test and we are going down the list sequentially and populating based on test results.

Sheet name to TestPlan and the first parameter on that sheet is "Task" and there is a naming convention there. TP01.01, TP01.02, 03 .. and so on.

Issue is when coding it, it is cell specific, so after a test is preformed it places pass or fail in parameter "PassFail" on the "TestPlan" sheet. We all know that the TestPlan gets shifted about and folks want to add, take away and move tasks around.

If we have the result determined in a variable called "TaskResult", is there a way to search the QTP sheet for that task, when found enter the value of TaskResult in the parameter "PassFail" of the row? This way it does not matter the sequence the task are coded in.  It is similar to the use of offset active.cell in Excel.  It is driven by the written tests that are occurring by the code. If that Task is not coded yet, I can put a default of "NotCoded" in the cell that are left in the PassFail parameter that are blank.

Has anyone done this before? and is there any suggested code that I could use for this? Trying to get a design direction on how to get around having to statically assigning values in a datatable.

Please advise and thanks.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gary PattersonVP Technology / Senior Consultant Commented:
I haven't done this, so take this for what it is worth:

If the results just get written out sequentially, can you simply output both the task name and the result, instead of pre-populating the spreadsheet with the task names and then trying to find the right row to update?
RWayneHAuthor Commented:
I suppose I could write it out to a s-sheet each time.  In VBA how would I goto Sheet1, do a find task TP01.01 (which will be there and in column A).  When it is found, goto column H and put in a "Passed". (or Failed).  I have a variable called TestResult, if TestResult = True Then "Passed" and if TestResult = False Then "Failed".

I did not want to not have to do this after each test but I can trigger excel code inside of QTP.  It just seems to me that it could be done in QTP also.  The work around would be to do this in Excel
Gary PattersonVP Technology / Senior Consultant Commented:
row = Application.WorksheetFunction.Match(xxx, Range("A1:A200"), 0)
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

RWayneHAuthor Commented:
Confused by the VBA reply, it looks like it is only finding the row?

is xxx what it is searching for in column A,  how do I get Passed or Failed in column H?  Also what if column A has more than 200 lines?  I do not want to limit the search and want to keep it dynamic.  Shouldn't it use offset on the row found to place the Pass or Fail result in it?  

Seach column A for task  (TP01.01) and when found put the word "Passed" in column H of the row that was found.
Gary PattersonVP Technology / Senior Consultant Commented:
I don't understand how you're getting your data to Excel.  Are you using Excel automation from your QTP script (I've see QTP scripting done in vbscript)?  Are you just exporting from QTP using a custom xsl (you said xls above - is that just a typo?).
RWayneHAuthor Commented:
One of the hard parts of this assignment is the need to use QTP, so I edit the default.xls in QTP contain the master test plans.  I then run SAP (from QTP and Excel) and use the import and export functions in QTP to compile the data.  (Excel when I do not know how to do a task in QTP, I run Excel macros inside of QTP by creating an Excel object, a workbook object and a sheet object, so I can write to the excel sheets from QTP,  then with that workbook open, I can call to any of the macros in it.

I am importing to QTP using commands like:
Which imports a sheet tab from Excel to QTP and then when I want to export back to an Excel file I use commands like:
Datatable.Export("C:\QTP\TestingScenarios\ThirdParty\TP01 - Customer Change - New Catalog Code\Third party Scenario 1a Results.xls")   'needs to use .xls, no xlsx, ?xlsm?

I do most of the work in VBA, and have scripted full test scenarios there, but I now have a requirement to begin using QTP and Quality Center.  I run a lot of macros inside of QTP that are triggered in QTP by using commands like:
myxl.Application.Run "MacroToUseInQTP.xlsm!BuildAnUploadNAXML"

I am still learning the QTP side, but if there are ways to get a result by use VBA I do.

The current need is in VBA, how do I tell excel to find a cell value (TP01,01) which will be in column A, and when found, enter the value of "Passed" in column H.  After I populate the excel piece that way, I can import/replace that sheet tab in QTP by re-importing the sheet into QTP.

I know that it sounds odd and it is a lot of back and forth etc, but I am having issues finding good documentation on running SAP in QTP.  I have mastered running SAP from Excel and collecting data, as there are many ways to do this depending on your access in SAP.  Hope this helps.

EE does not have a QTP section but does have good Excel/VBA support.  Do you know of any good QTP to SAP, and SAP to QTP resources?  My hope is that I can replace all the places in QTP that I have to goto Excel and perform a task, write it to Excel, then write it to QTP or import it...
Gary PattersonVP Technology / Senior Consultant Commented:
Unfortunately, I don't have any experience with QTP (now called UFT) in an SAP environment.

I do know that SAP provides direct support for testing using QTP - they even provide a couple of QTP licenses under some types of enterprise support agreements.  I'm sure that SAP or HP, or both offer training, documentation, and consulting services.

It sounds to me like you are accustomed to using your own tools to automate SAP testing.  I suspect that QC+QTP does a lot of the things you'd typically do manually - so instead of trying to force-fit your current tools and methodology, you may just want to start fresh and do things the "HP way" - use the tools the way they were designed.  QTP already has a mechanism for setting up your test plans, executing them, and producing reports - so I can't help but wonder if there is a real need to do this at all.

From what I can see, there is a pretty sophisticated eco-system between SAP and HP for testing automation.  It also looks like there are multiple tools, plug-ins, version dependencies, and more than we could get into here anyway.  This may not be a "learn it all yourself" sized task.  

I wish I had more to offer, but as I've mentioned this just isn't my area of expertise.  Hopefully another expert has more to offer.

Personally, I'd start by contacting the appropriate SAP and HP support resources and ask them for help.  My guess is that is going to be the best place to find training, documentation, and technology services.  It looks like there are some specific components that inter-operate, and there may be some optional components for QTP that you need to obtain and install to get the best integration.




Here's a short article that talks about the interrelationships between SALP Solution Manager, SAP TAO, HPQC, and QTP/UFE:

RWayneHAuthor Commented:
I have reviewed these and they did help a little.  Even posted to some of the discussion boards to see if anyone knows of a good book/resource that had scripting examples for SAP and QTP...  getting no replies.  I find it odd that SAP promotes the use of QPT/UTP with their product, but not finding some detailed coding examples to review...

Also thought it was odd the EE does not have QTP/UPT category for help..  must be there are no experts it?

I have google searched to find some you tubes and other posts on QTP but none that work with SAP examples.
Hope to find something to help... without having to pay big $$ to goto a conference or training sessions.  There must be some folks out there that have used QTP with SAP...  (I hope).  Still looking..
Gary PattersonVP Technology / Senior Consultant Commented:
Odds are sap and or hp have all the documentation and materials you might want.  May just not be published publicly.  Call SAP support and HP support and ask them what they have.  If you still can't find what you need post back here and ill try to help.
RWayneHAuthor Commented:
I have a post out on the SAP Community forum that has been out there for days now.  I have not approached this from the HP side.  Not giving up.  Thanks.
Gary PattersonVP Technology / Senior Consultant Commented:
Just looked and Help.sap.com seems to have a lot of testing documentation.
RWayneHAuthor Commented:
Thanks, not sure if I been to that one yet.  I have been on SAP's main site looking.  I will give that a try.
RWayneHAuthor Commented:
Odd, I went to the website and typed QTP and no searches found.  Same for UTP??
Gary PattersonVP Technology / Senior Consultant Commented:
I got several hits on "QTP".  I'd guess you're probably using the general search box instead of the supprot search box.   Also be aware that you may only be able to find some content if you are signed on with valid credentials.  

Here's just one quick example of a hit that I got:


If you'll take just few minutes and drill down through the ALM support stuff, you'll find testing-related documentation.  Looks like QTP integration falls under TAO.  

You'll probably need SAP support site credentials to get to the information you are looking for.

I just took like 5 minutes and clicked down through the following links and found some related information:


I'm afraid we're pretty much at the end of what I can do for you - and it doesn't look like any other experts are responding.  It also looks like there is quite a bit of documentation to keep you busy right on the SAP site.

Of course, I've already suggested what I think is the best course of action - calling SAP and HP and getting some of that expensive support your company is probably paying for.  That advice still stands.

Hope that's enough to at least get you pointed in the right direction.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RWayneHAuthor Commented:
Thanks for the help looking into this..
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.