Home All Groups Group Topic Archive Search About

How to use SendKeys for a ListBox in a Web Application?

Author
13 Oct 2005 8:33 AM
ppramoda
Hi

I'm completely new to QTP and VBScript. I'm working on a Web
Application.

What I need to test is as follows:

   In a web-page, I need to test whether by clicking the [DOWN]arrow,
the items in a listbox scroll-down.

Any help in modifying the logic shown below would be appreciated:


Sub ListBoxCheck(Window_Object, ListBox_Object)

   Dim objShell

   Set objShell = CreateObject("WScript.Shell")

   Array = Split(ListBox_Object.GetROProperty("all items"),";")

   i=0

   Do While i <= UBound(Array)


      Window_Object.Activate

      ListBox_Object.Focus

      objShell.SendKeys "{DOWN}"

      objShell.SendKeys "{ENTER}"


      If ListBox_Object.GetROProperty("value") <> Array(i) then

       Report Error

      End If

      i=i+1


   Loop

End Sub


Thanks...

Author
13 Oct 2005 7:32 PM
Mike L
You should probably ask this in a VBScript group. Try this one:

news://news.microsoft.com/microsoft.public.scripting.vbscript
Author
14 Oct 2005 6:17 PM
ppramoda
Thanks!!