How can I find out whether a word in a string is existed or
not
for example
"QTP IS A POWERFULL TOOL FOR AUTOMATION"
How can i find out whether "powerfull" is existed in the
above string or not
Could anyone answer it?
Answer Posted / nithya.m
Create a filesystem object . Read the file till the
letter "P" comes . After that Read till the length of the
word which you want to Check (In this case it is 9). then
compare the word with the word which you want to check
which should have been stored already . If the
stringcompare is true means, the word exists. Please go
through the following code for this example
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objReadFile = objFSO.OpenTextFile("FILENAME" ,1)
Str="Powerfull"
Str1=objReadFile.ReadAll()
Set objReadFile_new = objFSO.OpenTextFile("FILENAME" ,1)
For i = 1 to len(Str1)
Str2=objReadFile_new.Read(i)
if Str2=Left(Str,1) then
Str3=ObjReadFile_new.Read(len(Str))
if Str3=Str then
Msgbox "FileExist"
Exit For
End if
Next
| Is This Answer Correct ? | 2 Yes | 5 No |
Post New Answer View All Answers
How to Test the mainframe application?
How to indentify MS-Word objects like Menubar, Toolbar, table/columns/rows/cells etc within Word document, using QTP?
Hi All, I need code for how to execute qtp scripts from excell sheet
What is keyword driven framework?
tell me QTP standards ?plz
How to record a qtp script ?
Explain about the test fusion report of quicktest professional?
Please help me by providing the License key for QTP 9.2, at guru_aarya@yahoo.co.in Best Regards Gururaj.B
can any body tell me how i create a simple script and apply output value on it .pls send me a step by step process
What are private functions in QTP? How they can be called from the function library?
how to acess a test in RSA?
we use a file extension .properties why is it used and where do we use it plz help me out with detailed explanation and navigation of how to use on the QTP 8.2?
Hi, I am using 2 excel sheet.First excel sheet works fine with the script, if it opens the 2nd excel sheet,it works fine,but after finish all the rows it is giving the following error in the following line. InValid Procedure call or argument Line (178): "Browser("name:="&result,"application version:=internet explorer 7").Page ("title:=bgt.*", "index:=0").WebList ("name:=SearchType","html id:=Select1","location:=0").Select SearchType1". I have seen a web article says that,If we use any vbscript friendly name it may gives the above error-Invalid procedure call or argument not sure,Am I using any VBScript frienlyName? in the above line? [but the same line is perfecly working for first Excel ] It is little urgent. Any Help Thanks you
what type of run time errors you get while you ar edoing rpg program?
How many ways is to parameterize the value?