hi in QTP 8.2 in the edit box has text like "raju want
married" . i want to check "want" is their in the text
or not ?
Answers were Sorted based on User's Feedback
Answer / mahesh_sqa
var="Raju want to marry"
var1=InStr(1,var,"want")
if var1>0 then
MsgBox "String Exists"
Else
MsgBox "Doesn't Exists the String"
| Is This Answer Correct ? | 8 Yes | 0 No |
Answer / softwaretester4u
after R & D in Qtp i found the solution guys, use Instr()
function is useful for find the text .
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / srin
yes preeti you are correct. you can use regular expression.
like "srinkv@gmail.com" if you want to check "srin" in the
syntex it is "srin*" in vbscript & /srin*/ in jscript.
Agree with your comment
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sreekanth chilam
editbox_val="raju want married"
expected_val="want"
d=split(editbox_val," ")
( ...since d is an array....here d(0) contains "raju")
( ..here d(1) contains "want")
( ...here d(2) contains "married")
for i=0 to ubound(d)
act_val=d(i)
if (expected_val=act_val) then
msgbox "want is present - pass"
exit for
else
msgbox "fail - not present"
end if
next
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / ana
This can be easily checked with the help of Text Area
Checkpoint as this checkpoint can check the particular
Text/String in the paragraph, particular area can be
selected and checked for the Text/String.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / rangi
use the split and left function and if u dint get i il give
the code
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / srinath
One method is
a="Raju want to marry"
b="want"
if instr(1,a,b) then
msgbox("Exists")
else
msgbox("Does not exists")
end if
another method is
use regular expression. this is a bit lengthy
| Is This Answer Correct ? | 2 Yes | 2 No |
n=InputBox("Enter name")
var=Split(n," ",-1,1)
nam=var(1)
msgbox nam
If nam="want" Then
Services.LogMessage nam,OutputMsg
Else
Services.LogMessage"Failed",OutputMsg
End If
| Is This Answer Correct ? | 0 Yes | 0 No |
How to retrieve alpha bate from the alphanumeric string with special character.
suppose take one row in a row 16 columns is there.in 16 columns 16 numbers is there.but i want to get each 3 column number.o/p :5 columns get in 16 columns means. so can anybody write this function? plz send if u know the answer.
how do pass parameters from one action to another action
I am using DataTable.ImportSheet method to import the data from an excel sheet to the Runtime DataTable of QTP. here is my piece of code DataTable.import("c:\DataSheet.xls","Members","Members") The first row headings of Members sheet of DataSheet.xls and Members sheet of QTp are matched. but the QTP is taking very long time(approximately half an hour) to import the data into runtime datatable even though the DataSheet.xls has one or two rows in it. Please let me know why this is happening and is there any alternative for impoting the data into runtime datatable of qtp ?
Who uses qtp tool?
Please clarify Automation and QTP both(names) are same or diff?
Explain how you can find the absolute value of the number in qtp?
can u Give Procedure to Handle Pop Window & write Code for that
what is difference between analog and low level recording
We need to verify the user name & password in for the user validation. But we don't want to use the parameterization/ loop for user name and password. What is the way in scripting so that user & password will generate automatically.
what about f2&f6 function keys
how can i use text check point in descriptive programming. or else is there any way to compare the text in the application and the text in data table.