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
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 |
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 |
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 |
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 |
In QTP, If you have list of checkboxes, how can i select a particular checkbox and delete if the checkboxes are changing dynamically?
If I give some thousand tests to execute in two days what do you do?
what QTP Options do you know?
In an interview, what r the general questions asked in QTP? pls give me anwser to this question?
How to maintain the old scripts in QTP?
Using Regular expression method some particular value is not present in given value. HOow do use regular expression? Forexample password all number,character ,special character are accepted but (_',)underscore,comma are not used. How do write regular expression.
What is Automation frame work.How we will prepare in real time.
what are the metrics in general we use in testing.
What do you do if QTP doesn't recognize object ,what action should be taken
what you mean by artifact,milestone...
How cookies can be tested in QTP?
write a script to close all open browser in qtp except one browser whose name is xyz