SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Jul 2001
    Location
    Mission Viejo, CA, US
    Posts
    47
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Click method is not clicking HtmlText object

    SilkTest version 6.0.3
    IE version 6.0

    I have a HtmlText object that SilkTest can successfully recognize with no problems.

    However when I go to "Click" on the object, SilkTest will not click the HtmlText.
    (I need to click on this HtmlText object to invoke another page.)

    So, I thought I would use GetRect() to get the size and position information and use that within the Click method.

    This is where things become a bit strange...

    Here is what GetRect() returned:
    xPos 106
    yPos 501
    xSize 82
    ySize 22

    When I execute a Click(1, r.xPos+1, r.yPos+1)
    I receive the following error:
    *** Error: Mouse coordinate (213,1115) is off the screen

    If xPos equals 106 how can r.xPos+1 equal 213?

    Perhaps I've missed something here and hopefully someone can point it out.

    Has anyone seen this behavior before?

    Thanks in advance! [img]images/icons/smile.gif[/img]

    [ 10-02-2003, 02:35 PM: Message edited by: mswoager ]

  2. #2
    Senior Member
    Join Date
    Dec 2000
    Location
    Phoenix, AZ
    Posts
    371
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Click method is not clicking HtmlText object

    What are you performing the Click on? I have seen this when I try to do something like:

    BrowserPage.HtmlText("#1").Click(1, xPos, yPos)

    when it should really be

    BrowserPage.Click(1, xPos, yPos)

    Let us know if you find a solution.

  3. #3
    Senior Member
    Join Date
    Jul 2001
    Location
    Elizabeth, CO, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Click method is not clicking HtmlText object

    Michele,
    You're gonna hate yourself when you figure this out.

    Since the object is already 106 pixels from the left side of the page, and it's only 82 pixels wide, you're trying to click, relative to the page, 213 pixels from the left side of the page, which is outside of the object. So it's the error message that's wrong: the coordinates aren't off-screen, but they are off the object.

    Try one of the following:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">RECT r = MyPage.HtmlTextThingy.GetRect ()

    MyPage.Click (1, r.xPos + 5, r.yPos + 5)

    ---- OR ----

    // won't need to get the rect to do this
    MyPage.HtmlTextTHingy.Click (1, 5, 5)</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">I hope this helps.

    - Dave
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

  4. #4
    Member
    Join Date
    Jul 2001
    Location
    Mission Viejo, CA, US
    Posts
    47
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Click method is not clicking HtmlText object

    Thanks...and yes I do hate myself! [img]images/icons/smile.gif[/img]

  5. #5
    Member
    Join Date
    Apr 2003
    Location
    Fremont, CA, USA
    Posts
    61
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Click method is not clicking HtmlText object

    Try to do a SetFocus() before the Click()on HtmlText. I think you don't need to do GetRect().

    - rajesh

  6. #6
    Member
    Join Date
    Jul 2001
    Location
    Mission Viejo, CA, US
    Posts
    47
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Click method is not clicking HtmlText object

    The SetFocus() didn't help either.

    Dave Reed and kkoski solved the problem, but thanks for the suggestion. [img]images/icons/smile.gif[/img]

 

 

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:16 AM.

Copyright BetaSoft Inc.