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 qtp 9.5 demo ver,I am not able to record the yahoo broeser.so anyone can tell me what setting i have to do in QTP for yahoo brower recording. why its not recognise the object of yahoo browser????
Describe the differences between functions and actions in UFT?
What are the 3 main stages involved in testing with qtp?
What is qtp window?
Output values? i want a practical example
How many types of recording facility are available in quicktest professional (qtp)?
What is action?
Can we create user defined functions in qtp?
What are the types of object repository in qtp?
How many types of recording modes in qtp? Describe each type with an example where we use them?
Hi, Hope you viewers are doing fine with good health. What are the steps and connection parameters to connect to Oracle db ? Can you connect with just the Oracle client or Oracle XE ? Cheers!!
What is difference between Recording time object identification and Run time (Execution) time.
For example you are checking bit map check point before coming to the results. How can you say it is passed? Or failed? Anyways?
What Folder Structure following in Keyword Driven Frame work?
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?