SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Member
    Join Date
    Aug 2008
    Posts
    97
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Working on dynamic .net textboxes

    We have a .net application. one of its functions is to do a search based on search filters. One of the text boxes for the search critera accepts only number.

    Moreover, the "class" property of the textbox seems to change depending on its state:

    1. by default: "class:=x-form-text x-form-field x-form-empty-field"

    2. on click: "class:=x-form-text x-form-field x-form-focus"

    3. once it contains a numeric value: "class:=x-form-text x-form-field"

    The problem is when I simlpy do a...
    WebEdit("textbox"). Set 50 ...I can visually see the value but the application is not recognizing that I entered a value. This made me think that the application only recognizes mouse events and not browser events. So I tried...
    Setting.WebPackage("ReplayType")=2
    WebEdit("textbox"). Set 50
    Setting.WebPackage("ReplayType")=1
    ...but it didnt event keyed in the value


    any thoughts on how to solve this?

  2. #2
    Moderator
    Join Date
    Jan 2007
    Location
    Pittsburgh, PA
    Posts
    2,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Working on dynamic .net textboxes

    Give a try with FireEvent method and see what happens.

    Setting.WebPackage("ReplayType")=2
    WebEdit("textbox"). Set 50
    WebEdit("textbox").FireEvent "onclick"

    http://www.sqaforums.com/showflat.php?Ca...true#Post553554

  3. #3
    Member
    Join Date
    Aug 2008
    Posts
    97
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Working on dynamic .net textboxes

    Thanks for your suggestion but it wasn't keying in the value if there's a "Setting.WebPackage("ReplayType")=2"

    I'm still looking at the link you provided, hope I can get something from there.

  4. #4
    Moderator
    Join Date
    Jan 2007
    Location
    Pittsburgh, PA
    Posts
    2,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Working on dynamic .net textboxes

    Are you using double quotes around 50?

    Setting.WebPackage("ReplayType")=2
    WebEdit("textbox").Set "50"
    WebEdit("textbox").FireEvent "onclick"

  5. #5
    Member
    Join Date
    Aug 2008
    Posts
    97
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Working on dynamic .net textboxes

    I tried with and without double quotes and neither worked

  6. #6
    Member
    Join Date
    Aug 2008
    Posts
    97
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Working on dynamic .net textboxes

    Right now, I was able to make it work using "SendKeys"


    Below is my code, but I would appreciate if anyone could optimize it

    ---------

    Set WshShell = CreateObject("WScript.Shell")
    Setting.WebPackage("ReplayType")=2
    Browser("IE").Page("HomeSearchCriteria").WebEdit(" txtQuantityMin").Click
    WshShell.SendKeys Parameter("QuantityMin")
    Setting.WebPackage("ReplayType")=1

    ---------

  7. #7
    Moderator
    Join Date
    Jan 2007
    Location
    Pittsburgh, PA
    Posts
    2,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Working on dynamic .net textboxes

    How about this?

    hwnd = Browser("IE").GetRoProperty("hwnd")
    Browser("IE").Page("HomeSearchCriteria").WebEdit(" txtQuantityMin").Object.focus
    Window("hwnd:="&hwnd).Type "WhatEverData"

  8. #8
    Member
    Join Date
    Aug 2008
    Posts
    97
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Working on dynamic .net textboxes

    TReddy, thanks for your suggestion. Although another issue that I actually have is that by default, the cursor is at the URL textbox of the Web Browser.
    Browser("IE").Page("HomeSearchCriteria").WebEdit(" txtQuantityMin").Object.focus did not put the cursor on the textbox.

    So Window("hwnd:="&hwnd).Type "WhatEverData" was then keyed on the Browser URL textbox

  9. #9
    Moderator
    Join Date
    Jan 2007
    Location
    Pittsburgh, PA
    Posts
    2,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Working on dynamic .net textboxes

    Another try....

    Setting.WebPackage("ReplayType")=2
    hwnd = Browser("IE").GetRoProperty("hwnd")
    Browser("IE").Page("HomeSearchCriteria").WebEdit(" txtQuantityMin").Click
    Window("hwnd:="&hwnd).Type "WhatEverData"

  10. #10
    Moderator
    Join Date
    Oct 2010
    Location
    Norway
    Posts
    3,265
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Working on dynamic .net textboxes

    Jay,

    You could talk to the developer & know the trigger for this edit box.


    Have you tried all the events. Available events: onchange, onclick, ondblclick, onblur, onfocus, onmousedown, onmouseup, onmouseover, onmouseout, onsubmit, onreset, onpropertychange.

    Browser("IE").Page("HomeSearchCriteria").WebEdit(" txtQuantityMin").Set "50"
    Browser("IE").Page("HomeSearchCriteria").WebEdit(" txtQuantityMin").FireEvent event.
    Rajkumar

 

 
Page 1 of 2 12 LastLast

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 10.71%
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 09:41 PM.

Copyright BetaSoft Inc.