Results 1 to 5 of 5

Thread: Whenever event

  1. #1

    Whenever event

    I am having a problem using the whenever method. I did search thru previous topics and had a similar issue as a previous poster, but for some reason I still can't get mine to work.

    In my situation, when you browse to the website, there is a login pop-up. But, if you go to another site, and come back to our site, there isn't a login. So, I thought I could use the Whenever function. But it is not working. I think maybe I am just not getting it the idea on how to use this method.

    Here is what I have:

    Thanks in advance for your help!

    Sub Main()

    ' Attach to JACSBrowserObjectMap
    ComboBox("Index=1").Click 72, 4
    ComboBox("Index=1").SetText "www.mywebsite.com"

    ' Attach to Index=1
    EditBox.Type "{Return}"

    ' Attach to Name=treeframe
    HTMLAnchor("Caption='Job Options'").Click
    HTMLAnchor("Caption='Schedule Jobs'").Click

    'Dim ret As Boolean

    Whenever ("browserTest")

    End Sub

    Private Sub Script_Whenever(ByVal TheEvent As TPEvents.TEventGroup)

    Window("Application=IEXPLORE.EXE ClassName='#32770' Caption='Connect to jacssys03.hns-net.com'").Attach
    ComboBox("Parent.Label='&User name:'").DoubleClick 48, 10
    ComboBox("Parent.Label='&User name:'").SetText "userName"
    EditBox("Label='&Password:'").MouseDown 57, 8
    EditBox("Label='&Password:'").MouseUp -26, 1
    EditBox("Label='&Password:'").SetText "passWord"

    End Sub

  2. #2

    Re: Whenever event

    I have a similar situation. When you first go to the web site a window appears for a Security Alert to view the certificate. But once it appears, it usually doesn't come back. I tried the whenever method as well, but I also had problems with it. I resolved my issue by using Window Event. I know a lot of people don't like them, but I haven't had any problems and it works for me every time.

  3. #3

    Re: Whenever event

    I just wanted to post my resolution on this in case it benefits any of you.

    For some reason, window event was working for me, but it worked when I ...

    1.... changed it to a Screen event [that is what compuware support suggested].

    2....moved the whenever check to the first line of the sub procedure - something to do with test partner polling

    3....included a sleep/pause before the end sub so as to give it time to call the event handler.

    Hope it helps you.

  4. #4
    Senior Member
    Join Date
    Apr 2003
    Wisconsin, USA

    Re: Whenever event

    Thanks for posting your resolution. This is the type of interaction that really helps the forum grow.

  5. #5

    Re: Whenever event

    I have a similar issue, I tried using whenever to resolve it. My issue is that I am getting pagecannot be displayed while running the tests and I want the page to get refreshed so that script can run. So I tried writing new whenever event for this, but I the refresh method is not working. I am in webtesting.

    window.refresh--> I tried it, but it is not working...if any one has the same problem then help me in this regard.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 07:43 PM.

Copyright BetaSoft Inc.