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

anyone can explain about "Smart Identification" in QTP. what is the use of "Smart Identification" ???

1 Answers  


What are different types of frame works ?

3 Answers  


If the object property is changing very frequently, what was your approach?

2 Answers  


Hello Everyone, I have a problem. QTP is capturing no action on a particular page in the application that I am trying to automate. But on the same side its working fine on other pages of the same application. Can someone please help me understand the reason behind this inconsistency.

1 Answers  


Explain Descriptive Programming Types with Examples?

0 Answers  






how to get column count in datatable

3 Answers  


How i can use Regular expression in QTP?give detailed steps for it.

2 Answers  


can any one please tell me which is the best institute in Bangalore to learn QA (crash course)? Thanks

0 Answers   iFocus,


What is output value? How many types of output values are there in qtp?

0 Answers  


how to test Web application using QTP software

4 Answers   BITS,


In smart identification, explain about 1. Base filter properties 2. optional filter properties with examples?

2 Answers   TCS,


I want to grow as a Automation Engineer,Kindly help me in clearing my interview that what interviewer looks for as a Automation Engineer. I am having three years of experience in testing.

0 Answers   RBS,


Categories