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 |
What is the extension of script and object repositary files?
What is meant by Step Generator in Qtp How is it used? pls gimme in detail
Tell me about userdefined functions ?
can we call a test in another test?
After Creation of your QTp frame work, The folders are saved in VSS or Other. plz explain brifly?
Is there a function to find the number of occurrences of sub strings within a string?
ACTUALLY I AM WORKING IN THE DISTRIBUTION DOMAIN.MY COMPANY IS PROVIDING DISTRIBUTION SOFTWARE FOR PHARMA AND FMCG DISTRIBUTORS.HERE I AM USING QTP 9.2.HERE IN MY APPLICATION WHILE RECORDING ONE WINDOW APPEARS.IN THAT I CAN SELECT THE ITEM OR NO NEED TO SELECT.BUT WHILE RUNNING THE SAME SCRIPT THE WINDOW MAY NOT APPEAR OR APPEAR.HOW TO WRITE SCRIPT FOR THIS
Whenever we use GETROPROPERTY function.
Can anyone pls tell me in realtime (descriptive programming) how will the properties of the object be given to the test team. R they given in an excel sheet and is the same sheet also given to the development team and by whom is this given? Thanks a lot.
How to find Total no of Text Fields in the Page..Anybody please answer me..Thanks in Advance
Is there anyone can tell me where I can download free or trial QTP? I tried HP website, it was not there anymore. If someone know, pls send me URL. Tks...
If you are using descriptive programming and you have two objects with the same name, so you are identiying them by name and index, how can you avoid errors if a third object with the same name is added at the begining of the page?