In QTP I have a parameter in a datatable that is a
sentence. I need to take the last word from the sentence
and enter it into a field in a web application. How can I
setup a parameter to enter in just a portion of the
parameter (last word of the sentence) instead of the entire
paramater (whole sentence).

Answers were Sorted based on User's Feedback



In QTP I have a parameter in a datatable that is a sentence. I need to take the last word from the..

Answer / ravimmishra

SystemUtil.Run "notepad.exe", "","",""
iRCount = DataTable.GetSheet(dtGlobalSheet).GetRowCount
msgbox iRCount
For i = 1 to iRCount
sDatColVal = DataTable.Value("Comment")
sFinVal = Split(sDatColVal, " ")
iFinValLen = UBound(sFinVal)
Window("Notepad").WinEditor("Edit").Type sFinVal(iFinValLen) + micReturn
DataTable.SetNextRow
Next

Is This Answer Correct ?    4 Yes 0 No

In QTP I have a parameter in a datatable that is a sentence. I need to take the last word from the..

Answer / zak

Thank you for the helpful response! I included the code in
my script and it is taking the last word from the parameter
and putting it into notepad.

I now need to input this word into a field of the web page
as a security answer. What is the best way to do this? Is
it possible to replace the previous parameter (whole
sentence) with the new parameter (last word of the
sentence)?

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

How to test background color and dynamic images which are moving during runtime?

7 Answers   CTS,


Hi guys, Our company has started to automate testing and started using the tool QTP.Iam new to QTP and I have the following questions to ask. Would appreciate if anyone could give me a hand on this and explain things in a detailed way. [1] Bugs outside checkpoints: I know that I can easily make the QTP do what I want inside the application. Also, I know that I can insert some checkpoints and that the qtp will notice if those conditions are not met. However, there are bugs and problems that might not be connected to a checkpoint (system crash, database error, losing session/logout etc.); how can I make sure that the QTP will notice such problems as well and flag a test as failed. [2] How to tell the QTP that when a particular statement is "false",it should flag it as, test failed and show in in the test report. In short how to tell the qtp that a test is false from the script so that it shows it in the report For Eg:- if(true) test passed // how to instruct qtp else test failed // how to instruct qtp [3] Test script portability: we are having several environments; If I record a test on User Interface, obviously, the qtp will save the URL; however, how can I make the qtp run the tests so that the url is provided dynamically. Is there a possibility to parameterize the web server.Is this the way to do it.I dont know? [4] Test management: How do I manage the tests? I guess we will be doing it in Quality Center, yet, it’s not perfectly clear to me how we will be doing that. [5] Running scheduled test sets: How do I group tests to a certain test set? How can I make this test set run at a predefined time? [6] Test maintenance: What do we need to do beforehand in order to enable for easy test maintenance, meaning small adjustments in tests? [7] Reports: What kind of reports on test results are available (either QTP or Quality Center)? Thanks in advance and hoping for an answer. Jen

0 Answers  


How can we change(increase or decrease)the size of a array variable with out loosing the previous values

1 Answers   DST Global Solutions,


Please any on explain usage of "on error resume next","On error goto 0" with sample code....Thankyou......... when a tester is asked to execute 100 scripts in a short time..(the server will be down in another 10 min)..how he has to run those scripts?

2 Answers   Datamatics,


where do you define the objects as regular expression when u are using regular expressions.

4 Answers  






How will you find the current time of the remote machine using QTP script?

0 Answers  


how we can take data in the username field text box into variable in web application explain with example and give all functions to get data into variables

6 Answers   iton, TATA,


Explain about the Test Fusion Report of QTP ?

1 Answers   Ordain Solutions,


how can i count the number of links???

2 Answers  


When I used random numbers(1 to 9) with regular expression and run the test, it runs only 5 iterations with passed result instead of running all 1 to 9. Please tell me what can be the reason

0 Answers  


what is the defference between QTP 8.2 and 9.0and 9.2? plz tell me

6 Answers  


i want know iam working 2+ exp in QTP can i do performence testing (eg:loadrunner) yes r no?

6 Answers   IBM,


Categories