In my QTP script I have a word in notepad that ends in a
question mark, for example... "father?" As part of my
script I want to delete the question mark. How do you
delete a character in notepad?

Answers were Sorted based on User's Feedback



In my QTP script I have a word in notepad that ends in a question mark, for example... "fathe..

Answer / satya

U can do it with SFO script[I am not sure of Syntax or
exact code,just approach I m Mentioning Below]-
Set oObj=createObject("Script.FyleSystemObject")
oFile=oObj.openTextFile("YourPath")
Do Until EndOfSream
oStr=oObj.readLine
if InStr(oStr,"?")>0 Then
RePlace(oSter,"?","")
Loop

Is This Answer Correct ?    3 Yes 2 No

In my QTP script I have a word in notepad that ends in a question mark, for example... "fathe..

Answer / lak

Const ForReading = 1
'Save notepad file in D: Drive and type Father? then save

Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("D:\Find.txt", ForReading)

strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, "?", "")

Set objFile = objFSO.OpenTextFile("D:\Find.txt", ForWriting)
objFile.WriteLine strNewText

objFile.Close

Is This Answer Correct ?    1 Yes 0 No

In my QTP script I have a word in notepad that ends in a question mark, for example... "fathe..

Answer / saff

i am asuming there is only one "father?"
string in file
open the desired notepad
and them search for the desired string byusing instr
v = instr(filename,searchstring)'the position of the string
father
b=instr(filename,"?") 'the position of the ?
n =b-n ' will give the size of the string

now use the replace function to replace the ? with whatever
uw want

it will show the position of first occurance of the stirng

Is This Answer Correct ?    0 Yes 0 No

In my QTP script I have a word in notepad that ends in a question mark, for example... "fathe..

Answer / ratikanta

Word="father?"
Set Fso=Createobject("scripting.filesystemobject")
Set Fs=Fso.opentextfie("path")
X=Fs.Readline
mydata=split(X," ")
If mydata=word Then
str=Replace(mydata,"?","")
EndIf
msgbox str

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

explain keyword driven framework?

2 Answers   Mindlance,


What is the Major difference between QTP ; LoadRunner? If u want to test an 1. erp module which automation tool you would prefer and why? and 2. for web application, which tool and why?

2 Answers   Satyam,


what are the different kinds of frameworks in automation?

2 Answers   Accenture,


In an(AUT) web application their are two frames as fraMain and fraFooter. Both the frames contain link which needs to be retrieved at a single step. I tried it using "Regular Expression" as fra.* but QTP doesn't recognize the object. So Plz help me out to get resolve the problem:-)

1 Answers  


what is the diffrence bw qtp architectute and qtp framework?

0 Answers  






In QTP for .net application which plug in is used? For Java Application which plug in is used ?

2 Answers   AppLabs, Fraze Tech,


how can we merge the object repositories?is ther any option in qtp to merge the object repositories if we have two or three object repositories?

6 Answers   IBM,


What is the difference between per-action and shared?

0 Answers  


Can we directly start working with QTP without any knowledge on WinRunner? (After getting trsining on QTP)

1 Answers  


Reverse a string keeping the words in the string as it is. E.G. "Quick Test Professional" O/P "Professional Test Quick"

1 Answers   Cap Gemini,


If an application name is changes frequently i.e while recording it has name "Window1" and then while running its "Windows2" in this case how does QTP handles?

1 Answers   Crea,


What is the Diff between Image check-point and Bit map Check point?

4 Answers  


Categories