Micro Focus QTP (UFT) Forums

Full Version: Excel Questions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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?
For your second question:
Check QTP help, i've seen a SetCurrentRow Method. Is that what you're looking for?
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.
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...
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.
Dear Anna,
For your 3 rd question read the following post..
https://www.learnqtp.com/forums/Thread-e...de#pid1947

For your 1st question you can use switch case and try it.
I am not sure what this has to do with my 3rd question. Please explain ..
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
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?
Hi Anna,

To stop the execution you can use F4 Function key.
Pages: 1 2