SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Sep 2003
    Location
    United States
    Posts
    32
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to define handlers for mouse clicks or keyboard input

    Hi friends,
    The problem I'm encountering during low-level recording is:
    I'm having FirstName text field and after making input for 10 chars (for some validation) some methods has to be called (i.e., by typing) each and every char, a function or method is called namely handler1().It checks for the number of chars for every keying in.If it exceeds the max , it should generate some MsgBox.
    Could any one help in how to record this in low-level recording and also how and when to declare and access this method.Also is it possible to record such things in web event recording configurations - basic,medium and high.If so ,Plz specify how to do it.Tutorial info not enough.
    R.Raja

  2. #2
    Member
    Join Date
    Nov 2004
    Posts
    85
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to define handlers for mouse clicks or keyboard input

    Let me rephrase the question to be sure I understand it.

    The FirstName field only accepts 10 characters. If an 11th character is entered, a msgbox is popped to tell the user he entered too many characters. You need a function to test this.

    Is that right?

    If so, my first question is what happens when the user clicks OK on the msgbox - are all 10 characters still in the FirstName field or is it cleared?

    If my understanding is correct, then this is how I would code it:

    I don't think this should be done in low-level recording. I'm curious why you are using low-level to begin with.

    browser(A).page(B).edit("FirstName").Set"11charact er"
    If browser(A).page(B).msgbox.exist Then
    handle the box
    reporter.reportevent passed
    Else
    reporter.reportevent failed
    End If

    browser(A).page(B).edit("FirstName").Set"10charact e"
    If browser(A).page(B).msgbox.exist Then
    handle the box
    reporter.reportevent failed
    Else
    reporter.reportevent fassed
    End If

    Move on to other stuff

    This tests the boundary of too many characters and the upper boundary of just right. For most testing purposes, this should suffice (at least in regards to testing the 10-character limit).

    If you need more, you can parameterize it and put it in a loop from 1 to number of parameters. I would make one loop for valid entries and one for invalid.

    Hope that helped.

    Blake

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 05:06 PM.

Copyright BetaSoft Inc.