Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Copy content from a text file & paste it in text area in a web page
#2
Solved: 10 Years, 10 Months, 1 Week ago
Hi
Yes, it's possible.
Before running test you can save text, that should be copied, to some text file.
Below code that opens this file and reads it's content to some variable. As I understand, you know how to paste text in text area of browser, and you just need code how to read text from file.
I write function for you that receives pathToFile as argument and returns text, that this file contains:
Code:
Function readTextFromFile(pathToFile)
  'creating File System Object
  Set fso = createObject("Scripting.FileSystemObject")
  If fso.FileExists(pathToFile) = True Then
   'open text file for reading
   Set f = fso.openTextFile(pathToFile, 1)
   'read all text from file and return it to function
   readTextFromFile = f.ReadAll
   'close file
   f.Close
  End If
End Function

Using this function:
Code:
text = readTextFromFile(filePath)
Reply


Messages In This Thread
RE: Copy content from a text file & paste it in text area in a web page - by roxer - 12-02-2008, 09:39 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Read Content inside PDF kotaramamohana 0 1,115 09-02-2020, 05:49 PM
Last Post: kotaramamohana
  Can QTP handle slick grid table in a web page qtplearner88 2 4,320 10-01-2019, 10:44 AM
Last Post: shilpi952
  Capture All text from webpage and copy it... mpatra 3 4,934 07-25-2018, 05:33 PM
Last Post: vimlesh
  how to write the content obtained using the method GetPdfText Anisha 0 1,355 10-24-2017, 08:49 PM
Last Post: Anisha
  LearnQuickTestPDF -does not work on just getting the text jloyzaga 0 1,194 02-10-2017, 10:59 AM
Last Post: jloyzaga

Forum Jump:


Users browsing this thread: 1 Guest(s)