Saturday, January 23, 2010

Make Your QTP Script Talk

Make your QTP script talk to you. Try the below code, the script will tell you the current iteration number. Before running the script, please switch on your PC's speakers.

Set oVoice = CreateObject("sapi.spvoice")
oVoice.Speak "Iteration "&Environment.Value("TestIteration")
Set oVoice =Nothing


Reference: http://en.wikipedia.org/wiki/Microsoft_Speech_API

5 comments:

  1. Nice bit of code, not sure I've got a valid business use for it at the moment but its very interesting!

    ReplyDelete
  2. This is interesting.

    ReplyDelete
  3. Its interesting but I am getting the general run error on the line of code
    oVoice.Speak "Iteration "&Environment.Value("TestIteration")
    do i need to have any thing installed on my machine to work

    ReplyDelete
  4. Its interesting and nice one....thank u Asiq Ahamed and thank u so much...

    ReplyDelete
  5. can you provide training on framework design and devlopment or if not possible can you provide some contacts who can help on the same.All your posted scripts are awesome.

    ReplyDelete