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 create flat file datasubmission in qtp
Does QTP run in any environment?
I want to do Certification course in QTP. For this I request you to suggest the best Tutorial in PDF format. Hence, if possible, kinldy mail PDF file to my mail-ID: sushmapokhriyal79@gmail.com
i can done the project with QTP in that time i can say how many members in my team size?
How to find a window is minimized or not
What is text/text area checkpoint?
i have doubt suppose iam purly working in manual, when i will get work to do on sql and performence testing? pls any one clarify doubt?
How to analyzing test results using quicktest professional (qtp)?
Shall we add Local Repository to shared object repository,if yes,how we add
we add library file used in test via settings or through "ExecuteFile" command. when we implement framework do we make common library file and load the same for all the test cases execution?
What is the difference between byref and byval in qtp?
What are the 3 main stages involved in testing with qtp?
How do you synchronization point through DP?
What are the recording modes in qtp?
What is the Difference between test object and run time object?