Results 1 to 4 of 4

Thread: Opening notepad in QTP &Writing of Test Result in Notepad.

  1. #1
    Contributing Member
    Join Date
    Feb 2008
    Answers
    40

    Opening notepad in QTP &Writing of Test Result in Notepad.

    Opening notepad in QTP &Writing of Test Result in Notepad.


  2. #2

    Re: Opening notepad in QTP &Writing of Test Result in Notepad.

    Please check your mailbox. I wasn't able to Indent the script property and it just showed like one paragraph. So I have mailed it to you. I will attach a word file for others to view soon.


  3. #3
    Expert Member
    Join Date
    Sep 2007
    Answers
    110

    Re: Opening notepad in QTP &Writing of Test Result in Notepad.

    Can you share the answer for this question what anshoo is sent to you.


  4. #4
    Contributing Member
    Join Date
    Feb 2008
    Answers
    40

    Re: Opening notepad in QTP &Writing of Test Result in Notepad.

    Dim oFSO, oFile, strText
    Set oFSO=CreateObject(“Scripting.FileSystemObject”)
    Set oFile=oFSO.CreateTextFile(“ExactLocationOfFile”, True)
    ‘Write 3 lines with 3 spaces
    For i=1 to 3
    oFile.WriteLine “hello World” &i
    oFile.WriteBlankLines 1
    Next
    oFile.Close
    Set oFile=Nothing
    Set oFSO=Nothing

    The original code is by Dani Vainstein. I have made some modifications. You can modify the code to do the operations you want. This code will write Hello World 3 times in a text file. You can modify it as following to write as many inputs to the text file as you want.

    I have modified the following code to suit your requirement:

    Dim oFSO, oFile, strText
    Set oFSO=CreateObject(“Scripting.FileSystemObject”)
    Set oFile=oFSO.CreateTextFile(“ExactLocationOfFile”, True)
    oFile.WriteLine “” &strFirstResult
    oFile.WriteLine “” &strSecondResult
    oFile.WriteLine “” &nthResult
    ‘oFile.WriteBlankLines 1
    oFile.Close
    Set oFile=Nothing
    Set oFSO=Nothing

    Values from strFirstResult, strSecondResult and nthResult come from the output of your code. For eg:

    strFirstResult=Browser(“”).Page(“”).WebEdit(“”).GetROProperty (“name”)

    Now, strFirstResult will be written to the first line of the notepad file.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact