SPONSORS:






User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Junior Member
    Join Date
    Jul 2001
    Location
    hartford, ct, usa
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HTMLColumn and javascript Onlick

    ********************************************
    So far, I have no problem identifying cells in the HTMLtable. The problem I have is that I want to click on a particular cell (without using coordinates) to fire an OnClick event.

    Example:
    I identify row 3 as the row I'm looking for.
    I know that I want to click on HtmlColumn8 for this particular row (to fire the OnClick event).

    Does anyone know how to pin-point the location of this cell reliably??
    Much thanks!!!


    First, my declarations show the following:
    ###########################################
    [-] HtmlTable HtblSearch
    [+] multitag "Search"
    [ ] "^Search"
    [ ] "#1"
    [ ] "@(549,226)"
    [-] HtmlColumn HtmlColumn1
    [+] multitag "#1"
    [ ] "@(55,226)"
    [-] HtmlColumn HtmlColumn2
    [+] multitag "#2"
    [ ] "@(87,226)"
    [-] HtmlColumn HtmlColumn3
    [+] multitag "#3"
    [ ] "@(239,226)"
    [-] HtmlColumn HtmlColumn4
    [+] multitag "#4"
    [ ] "@(514,226)"
    [-] HtmlColumn HtmlColumn5
    [+] multitag "#5"
    [ ] "@(808,226)"
    [-] HtmlColumn HtmlColumn6
    [-] multitag "#6"
    [ ] "@(980,226)"
    [-] HtmlColumn HtmlColumn7
    [-] multitag "#7"
    [ ] "@(1012,226)"
    [-] HtmlColumn HtmlColumn8
    [-] multitag "#8"
    [ ] "@(1044,226)"
    [ ]


    ********************************************
    The javascript for row 3 of HtmlColumn8:

    OnClick="JavaScript:btnNewOffice();">



  2. #2
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HTMLColumn and javascript Onlick

    There are a couple of things you can try. You can do TableName.ClickCell({3, 8}).

    Or, you can do something like:

    I realize you said you don't want coordinates, and I understand that. I rarely use them myself, except in cases like this where the coordinates are those of the specific cell rather than relative to the edge of the screen.

    There are a myriad of things you can to do identify and click on a cell. Look in the library browser on the methods tab and scroll down till you find "Table." You'll see a list of available methods.

    Good luck.

    ------------------

  3. #3
    Junior Member
    Join Date
    Jul 2001
    Location
    hartford, ct, usa
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HTMLColumn and javascript Onlick

    Thanks, DJGray, but unfortunately, I'm looking for a solution for the HTMLTable Class (method or work around), not the Table Class.

    so far, I haven't found anything.

    Is there a way to set up methods like .ClickCell() to work with a different class? (does anyone inherit methods from pre-defined classes to be used in other pre-defined classes?) if so, an example would be great.

    many thanks in advance!!!

  4. #4
    Member
    Join Date
    Dec 2000
    Location
    San Francisco, CA
    Posts
    51
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HTMLColumn and javascript Onlick

    Hi davey,

    If you have a unique text on the particular cell you want to click that can help you getting the coords of your cell.

    e.g.

    The unique text doesn't need to be on the cell you want to click, text on the same row but on a different column can also help you but you need to modify the above example to include coordinates. That I leave up to you to find out.

    ------------------

  5. #5
    Junior Member
    Join Date
    Jul 2001
    Location
    hartford, ct, usa
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HTMLColumn and javascript Onlick

    kalabog, thanks for your help, but unfortunately I'm not getting it:


    *** Error: Window '[HtmlText]the text I was looking for' was not found

    The .GetRowText() works - it retrieves the text I want.

    However, when I pass it to the HtmlText object, it gets confused. (maybe because the HtmlText is not explicitly defined in the declarations (because the Test Frame doesn't see it)

    Because you mentioned that the cell needs to be unique for the method to work, I pointed to a unique cell.

    However, I am looking to implement this for a non-unique cell (the entire column contains the same text).

    Anyone else have ideas that will avoid using coordinates???

    Much thanks!!!

  6. #6
    Member
    Join Date
    Dec 2000
    Location
    San Francisco, CA
    Posts
    51
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HTMLColumn and javascript Onlick

    davey,

    Can you pls send me a sample html page of your table. Include all the columns but if you prefer to mask the actual cell values, pls do so.

    Thanks.

    Let's take this offline first so just send it to my email address.

    kalabog73@hotmail.com

    ------------------

  7. #7
    Member
    Join Date
    Dec 2000
    Location
    San Francisco, CA
    Posts
    51
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HTMLColumn and javascript Onlick

    hi davey,

    i attached a zip file containing 2 files 1 is an html page and 1 silktest script. why don't you try these. i included three possible workarounds for you. 2 of which relies on unique row text and the other 1 may well apply to your case. the objects that are needed for these need not be included in your windows declaration at all, as you can see.

    for the htmltext that was not found, maybe the text your are looking for must be wildcarded for it contains special characters.

    if you still don't want to use coordinates, maybe you could try using ExecScript() instead. i believe there was already a discussion regarding this, so just search for it.

    thanks and good luck.

    ------------------
    kalabog73@hotmail.com

  8. #8
    Junior Member
    Join Date
    Jul 2001
    Location
    hartford, ct, usa
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HTMLColumn and javascript Onlick

    Hi kalabog!

    Thank you so much for your dedication to this issue. I'm greatful!

    I've attached a zip file containing sample.html and subfolders with supporting files.

    I tried the work arounds you suggested, but the fundamental problem is that the HtmlText object is not visible to SilkTest.
    (I'm not sure why)

    The error I receive:
    (local) *** Error: Window '[HtmlText]ABC Service' was not found

    Any other seasoned ideas??


    Thanks so much for your help !!!!!!!!!

    ------------------

  9. #9
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HTMLColumn and javascript Onlick

    What's the problem? I can see everything.

    Try to change table settings depending if you are using DOM or VO. Search in the forum for the code.

    It might help. Are you looking for fixed or dynamic text??

    ------------------

  10. #10
    Junior Member
    Join Date
    Oct 2001
    Location
    india
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HTMLColumn and javascript Onlick

    Hi Davey.

    I am also facing the same Problem..
    Hi 'GODKNOWS'.
    i even tried to set the Dom extension settings
    Showborderlesstable as '1'....but still silk is not recognising the cell...
    pls tell me how should i proceed...

    thanks


    ------------------

 

 
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
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin 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 07:21 PM.

Copyright BetaSoft Inc.