Micro Focus QTP (UFT) Forums
Excel Questions - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Excel Questions (/Thread-Excel-Questions)

Pages: 1 2


Excel Questions - Anna - 07-10-2008

I have 3 questions ..
1. I would like to put an index in the Excel spreadsheet instead of the word. For example if the name Anna is the second in the dropdown list I would like to put "2" instead of "Anna" How can I do that? Winrunner has this capability but I cannot figure out how to do this in QTP?
2. When using Excel I would like to be able to start from any row.. not just row #1. I cannot seem to figure this one out either. Again Winrunner had this ability.
3. How do you stop the scrip other then clicking the stop button?


RE: Excel Questions - QADBA - 07-10-2008

For your second question:
Check QTP help, i've seen a SetCurrentRow Method. Is that what you're looking for?


RE: Excel Questions - Anna - 07-10-2008

DataTable.GetSheet("").SetCurrentRow(6) this works but what goes here ("") I had to take out "MySheet" obviously but the name of my data table did not work either.


RE: Excel Questions - QADBA - 07-11-2008

I'm new on QTP, but i thing its depending on the sheet you're using.
If you use the GlobalSheet, you can write:
DataTable.SetCurrentRow (6)

For more Information take a look at:
https://www.learnqtp.com/qtp-and-excel-part1/
https://www.learnqtp.com/qtp-and-excel-part2/
https://www.learnqtp.com/qtp-and-excel-part3/

I hope this helps...


RE: Excel Questions - Anna - 07-11-2008

Thanks. This helpsSmile Well .. links 2&3 do not work but link 1 has some useful info. Now I just need #1 and #3 answered.


RE: Excel Questions - somisays - 07-11-2008

Dear Anna,
For your 3 rd question read the following post..
https://www.learnqtp.com/forums/Thread-exit-from-code#pid1947

For your 1st question you can use switch case and try it.


RE: Excel Questions - Anna - 07-11-2008

I am not sure what this has to do with my 3rd question. Please explain ..


RE: Excel Questions - QADBA - 07-11-2008

If i understand your third question, you want to stop running your script on a definite event. Is that right?
Then you can use somisays link to the other post...

Or do you mean a testing situation and you only want to test a small part of your script?
In this case you can insert a breakpoint (Debug>Insert/Remove Breakpoint) at your current line, so that your script automatically stops at this point instead of running through the whole script. Smile


RE: Excel Questions - Anna - 07-11-2008

I just want to stop the script at any point in time but sometimes I cannot access the STOP button because the cursor is controlled by QTP to some degree so I was wondering if there was a hot key?


RE: Excel Questions - somisays - 07-11-2008

Hi Anna,

To stop the execution you can use F4 Function key.