SPONSORS:






User Tag List

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Feb 2001
    Location
    San Mateo, CA, USA
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Dealing with dynamic content

    Hey All,

    I'm still a novice when it comes to ye olde SilkTest, so please excuse me if this turns out to be a simple query, or just plain loony:

    I'm working with a web app that generates a page containing a table of results after the customer inputs all of the applicable information. This table may contain any number of rows (each containing two columns), depending on the data entered by the customer.

    During the verification of each case, I'd like to print out the text of each row along with the results of each test case.

    Currently, I'm using the caveman style of manually tailoring each individual testcase towards the expected results (i.e. get rule_1, print rule_1, get rule_result 1, print rule_result 1, etc.). What I'd like to do is is just make 'rule' and 'rule_results' into arrays and have it step through the values 1 by 1 until it encounters a null value.

    I have no problem coding up the loops and 'if' and 'for' statements it would take to do this at least semi-properly, but my problem lies in the objects in the include file itself and how it figures into these statements. I need to identify the contents of the table using an HtmlText object within the include file, but I want to be able to step throuigh these values one by one while in the 'for' statemenst, but it seems that would necessatate having an HtmlText object that is an array, allowing me to step through the values as I print to the report....but that ain't allowed,a t least with my limited knowledge of SilkTest.

    Anybody have any ideas? Thanks in advance.

    ~Casey

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

  2. #2
    Senior Member
    Join Date
    Jan 2002
    Location
    Des Moines, Iowa
    Posts
    289
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Dealing with dynamic content

    If your table is a HTML table I have been messing with that all week and have had some great successes and some amazing failures .

    This might be something you could use. Kind of an example any way.

    [-] testcase example() appstate none
    [ ] integer iRowCount
    [ ] integer iNextRow
    [ ] LIST OF STRING lsColumn1
    [ ] LIST OF STRING lsColumn2
    [ ]
    [ ] iRowCount = MyWindow.MyTable.Col1.GetRowCount()
    [-] for iNextRow = 1 to iRowCount
    [ ] ListAppend(lsColumn1, MyWindow.MyTable.Col1.GetRowText(iNextRow))
    [ ] ListAppend(lsColumn2, MyWindow.MyTable.Col2.GetRowText(iNextRow))
    [ ] //Some sort of compare here. Didn't give enough info to figure it out.
    [-] for iNextRow = 1 to iRowCount
    [ ] print ("First Column Text: {lsColumn1[iNextRow]}, Second Column Text: {lsColumn2[iNextRow]}, Row number {iNextRow}")
    [ ]
    ------------------


    [This message has been edited by blacst (edited 01-28-2002).]

 

 

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 11:01 PM.

Copyright BetaSoft Inc.