Solved

QTP and SAP

Posted on 2014-11-25
15
198 Views
Last Modified: 2016-11-17
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.
0
Comment
Question by:RWayneH
  • 8
  • 7
15 Comments
 
LVL 34

Expert Comment

by:Gary Patterson
ID: 40466803
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?
0
 

Author Comment

by:RWayneH
ID: 40471994
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
0
 
LVL 34

Expert Comment

by:Gary Patterson
ID: 40472709
row = Application.WorksheetFunction.Match(xxx, Range("A1:A200"), 0)
0
 

Author Comment

by:RWayneH
ID: 40472724
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.
0
 
LVL 34

Expert Comment

by:Gary Patterson
ID: 40472986
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?).
0
 

Author Comment

by:RWayneH
ID: 40474151
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:
DataTable.ImportSheet"C:\QTP\ImportFileForQTP.xls","SOLNData","SOLNData"
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...
0
 
LVL 34

Expert Comment

by:Gary Patterson
ID: 40474525
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.

http://www8.hp.com/us/en/software-solutions/unified-functional-testing-automation/?jumpid=reg_r1002_usen_c-001_title_r0001

http://h30499.www3.hp.com/t5/Functional-Testing-QTP/ct-p/sws-Fun_Test

http://h30499.www3.hp.com/t5/The-Future-of-Testing-Blog/Using-SAP-structured-parameters-in-HP-Unified-Functional-Testing/ba-p/6202025#.VHzDkck_fAE

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

http://martijndevrieze.net/2012/11/13/test-automation-on-sap-is-it-really-that-much-different/
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:RWayneH
ID: 40483232
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..
0
 
LVL 34

Expert Comment

by:Gary Patterson
ID: 40483544
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.
0
 

Author Comment

by:RWayneH
ID: 40483794
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.
0
 
LVL 34

Expert Comment

by:Gary Patterson
ID: 40483950
Just looked and Help.sap.com seems to have a lot of testing documentation.
0
 

Author Comment

by:RWayneH
ID: 40489541
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.
0
 

Author Comment

by:RWayneH
ID: 40489553
Odd, I went to the website and typed QTP and no searches found.  Same for UTP??
0
 
LVL 34

Accepted Solution

by:
Gary Patterson earned 500 total points
ID: 40489684
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:

http://help.sap.com/saphelp_tao30_sp02/helpdata/en/9d/7b08529e15be64e10000000a423f68/frameset.htm

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:

http://help.sap.com/alm
http://help.sap.com/saptao30/
http://help.sap.com/saphelp_tao30_sp02/helpdata/en/59/c592cf76844fbbadc7bd8c914cfcc5/frameset.htm
http://help.sap.com/saphelp_tao30_sp02/helpdata/en/59/c592cf76844fbbadc7bd8c914cfcc5/content.htm?current_toc=/en/22/a2f0e72a2d48f3bd12578189cc24ce/plain.htm&show_children=true

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.
0
 

Author Closing Comment

by:RWayneH
ID: 40501226
Thanks for the help looking into this..
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now