SPONSORS:






User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Senior Member
    Join Date
    Oct 2001
    Location
    Worcester
    Posts
    133
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    defining and using links defined in a TextField

    Please Help.
    I am testing a JavaStandAlone app. One window on my app contains a JavaJFCTextField and in this text field is html code. The html code displays links which I need to be able to click. However I cannot figure out how to define the links and be able to click them. I have uploaded a screen shot and the results when I do GetContents(). Can anyone help me with being able to define the links or fine the location to click.

    Thanks in advance


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

  2. #2
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: defining and using links defined in a TextField

    What do wTextField.GetText () and wTextField.GetMultiText () return?


  3. #3
    Senior Member
    Join Date
    Oct 2001
    Location
    Worcester
    Posts
    133
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: defining and using links defined in a TextField

    GetText() returns <html>, the first line in the attached file.

    GetMultiText() the same as GetContents()

    I guess my problem is it possible for SilkTest to click a Link in a TextField, if so I am struggling to figure out how to get it to recognize the link


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

  4. #4
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: defining and using links defined in a TextField

    SilkTest doesn't have the built-in capability of clicking a link inside a text field, you'll have to figure out where the link is located within the text field, then click the link using coordinates.

    You could select the text with the keyboard, copy it to the clipboard, then read the text (Clipboard.GetText ()) and try to calculate which column to click on (x pos). This will be more complicated if the links use different fonts or sizes. The y pos will be the row * the number of pixels per row.

    Once you have the locations, you can do:
    wTextField.Click (1, xPos, yPos)

    Hope this helps.



    ------------------
    John W Green
    jwgreen@automationexpertise.com
    http://www.automationexpertise.com

  5. #5
    SQA Knight
    Join Date
    Jul 1999
    Location
    Grand Rapids, MI
    Posts
    3,727
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: defining and using links defined in a TextField

    This also might be worth a try...

    You might *try* [I don't currently have a usable copy of SilkTest] to use John Green's advise to determine the starting row and column numbers of the link and then use the SetSelRange() method to to extend/highlight a small portion of the link [for example the first 5 chars in "http:", but any starting pattern will do]. I *think* at that point the cursor will be over the last highlighted character--now using the Click() method [without the optional x/y coordinates] might very well cause the link to be invoked.


    -Hope this helps, Terry Horwath


    [This message has been edited by Terry Horwath (edited 08-05-2002).]

  6. #6
    Senior Member
    Join Date
    Oct 2001
    Location
    Worcester
    Posts
    133
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: defining and using links defined in a TextField

    Terry and John thanks for the help.. I am making progress, I think. I have one more question however. I am able to select the text and copy it to the clipboard, but now I want to figure out how to calculate the location of certain text. I understand I can have a problem with different font sizes, but I an not sure how to determine the pixels. For example if I had 'AAAA' how would I determine how many pixels to the last 'A'.. Any insight would help.. Thanks alot


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

  7. #7
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: defining and using links defined in a TextField

    All of this effort is to ensure that the HTML links work, right?

    Then why bother with clicking their actual screen locations (if you have them in the Clipboard) when you could just paste them into the location line on your Browser and press the Enter key?

    Granted its nice to click the location as a user might but realise what you're actually testing at that point is the Browser's support for HTML, not your development groups' code. Check one manually and forget the rest.

    Font concerns begin to imply attempts to perform qualitative testing using automation.
    Leave those, and other presentation issues like it, to a human tester.

    John


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

  8. #8
    Senior Member
    Join Date
    Oct 2001
    Location
    Worcester
    Posts
    133
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: defining and using links defined in a TextField

    Its not a web application. When you click it displays another window with a listbox, or textfield.. Therfor, I cannot just paste it into a browser..

    Thanks anway for trying to help

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

  9. #9
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: defining and using links defined in a TextField

    Are the underlined links and colors retained in you clipboard image? (I believe that all you'll see is raw text.)

    Are the files for these links retained in a local folder? Can they be loaded into a Browser or preferably into Word?

    Last question: Can you drag the cursor within the displayed text to highlight it?


    John


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

  10. #10
    Senior Member
    Join Date
    Oct 2001
    Location
    Worcester
    Posts
    133
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: defining and using links defined in a TextField

    The color is not retained.. I can get the text from the clipboard, but I need to then be able to find the location of the text, i guess in pixels, and then when i know the location i can click it.. I am curious how I can find out how many pixels are used for say a character.. I know font, boldness.. matters but this is all i can think of right now.

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

 

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

Copyright BetaSoft Inc.