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


Please Help Members By Posting Answers For Below Questions

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?

618


Explain the N-tire structure(process) for Funds Transfer ( means give N ways to funds Transfer in an Application)

1639


What is file database?

1696


What are the views available in quicktest professional?

563


Please help me by providing the License key for QTP 9.2, at guru_aarya@yahoo.co.in Best Regards Gururaj.B

2914






how can we compare descriptive programing with a regular expression

1925


Hoe can we do retesting using functions please give the code for it using login page

1570


explain structured testing? plz guys with exp. do answer

1414


What is a Patch in QTP?

608


Why we load add-ins in qtp?

632


Define object spy ?

568


Hi, Can we open a test in qtp10 which is saved in qtp 9.2?

1440


Explain different types of checkpoints?

563


In an interview, what r the general questions asked in SQL which is realted to testing ?pls give me anwser to this question?

1445


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?

578