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
I have created 3 actions in test action1, action2, action3 but I want run action 1,action 3,action2 how can you change in the actions in keyword view?
Explain the N-tire structure(process) for Funds Transfer ( means give N ways to funds Transfer in an Application)
What is file database?
What are the views available in quicktest professional?
Please help me by providing the License key for QTP 9.2, at guru_aarya@yahoo.co.in Best Regards Gururaj.B
how can we compare descriptive programing with a regular expression
Hoe can we do retesting using functions please give the code for it using login page
explain structured testing? plz guys with exp. do answer
What is a Patch in QTP?
Why we load add-ins in qtp?
Define object spy ?
Hi, Can we open a test in qtp10 which is saved in qtp 9.2?
Explain different types of checkpoints?
In an interview, what r the general questions asked in SQL which is realted to testing ?pls give me anwser to this question?
An action has both shared and local OR associated with it and both have the same object in them. In the test which one will be considered?