SPONSORS:






User Tag List

Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Feb 2000
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    include files for web pages

    Is there any way to automatically generate include files for web pages? I've seen people talk about this here a couple of times but I've seen no actual solutions. What I've been doing so far is using record window declarations on the page. So if the page is Yahoo I'd get:

    window BrowserChild Yahoo
    tag "Yahoo!"
    parent Browser

    and then it would list all the images, links, and whatever else. What I want is a way to do this automatically by having the test script simulate the record window declarations functionality if this is possible. The first part is easy because I just have to call up the browser and then load the page. But the next part is I've got write the script so that it simulates the record window declaration functionality and then writes that information to a file that will become the include file. Is there any way to do this? I'm not concerned if it requires the mother of all scripting and I don't need it to go through multiple pages on the site. I just need it to generate all information for the page I'm currently viewing.

  2. #2
    Junior Member
    Join Date
    Feb 2000
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: include files for web pages

    Actually I might have answered some of my own question somewhat. I guess I could use the inet control right? Then I could parse the page based on the info returned from inet. This still doesn't answer the logic part of the question but this is a way to go about it unless I'm missing something.

  3. #3
    Member
    Join Date
    Jul 1999
    Location
    Raleigh- North Carolina
    Posts
    30
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: include files for web pages

    Take a look in "testing web aplication" tutorial. It's pretty simple, and the best way to put your hands on Silk Test.

    Mauro Almeida

  4. #4
    Senior Member
    Join Date
    Dec 1999
    Location
    Chicago,Illinois,USA
    Posts
    2,537
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Re: include files for web pages

    You could use Inet but I would only recommend that if you are not using a version of Silk that recognizes the browser specific features. The problem with Inet is you have to watch out for frames because Inet will grab a frameset page and not the framed pages - at least initially. You also might run into some sites that use the BASE HREF tag which might cause you problems unless you build in some convoluted logic. You end up doing a lot of conditional logic to look for the SRC attribute of frames as well as any JavaScript links.

    I think the best thing is let SilkTest do the work; treat the page as a black box by just reading what SilkTest can read - after all this is what will make up your include file in the end. Make the GetChildren() method your friend. You can get the children for the main page and then if that page has any children (which should be frames), you can get their children, etc. Then you could probably use something like the GetContents() method and do some conditional logic on whatever it returns.

    Also: in direct answer to your question, look in the Help file at the GenerateDecl() method. It does exactly what you are talking about in your post.

    [This message has been edited by JeffNyman (edited 02-16-2000).]

  5. #5
    Junior Member
    Join Date
    Feb 2000
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: include files for web pages

    I checked out the methods you're talking about and they're nifty. But how would you about setting something like this up? Do you have any examples or is this something you've done before? I'm real new to this so any help is appreciated. Also I supposed I could write the generated files to an include file that could be immediately used? We're really trying to get away from human intervention in much of our process so as much as can be automated as possible is great. There were some huge promises made about what automation tools can do and now we've got to live up to them.


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

    Re: include files for web pages

    The way to approach this is to treat it like a computer game where you open doors, look inside, collect the treasures, and leave bread crumbs along the way to keep from getting lost and to remember where you have and haven't been.

    It's a fun exercise in recursion, but the results aren't very useful when the tag-algorithm assigned object names get cryptic - often very quickly. You will still have to go back to review and adjust the object and and tag strings. Realize too that the defective name has been replicated into every child object to the end of a branch - more work. It's possible to correct this 'automatically' by maintaining the nesting structure internally, but that's more work involving considerable string manipulation.

    A better approach is to manually record the primary sections as you build the functional tests and use various QAP/Silk dynamic commands to recognize where additions and deletions of objects have occurred within the application. Aftering adding the Invoke() logic for every node, you can then fire up a generic test that will report all of these differences given only the name of your baseline declaration file.

    However as nifty as this sounds, the best approach especially when new at QAP/Silk, is to leave this alluring "magic bullet" to off hours and concentrate on building the test suite for the target application. Push as much logic as deep into the class structure as possible. Like computer games the magic bullet will draw you in and chew up a hugh number of hours without any certainty of reaching the end.

  7. #7
    Senior Member
    Join Date
    Dec 1999
    Location
    Chicago,Illinois,USA
    Posts
    2,537
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Re: include files for web pages

    To some extent I agree with John's comments above. But if you are looking for examples, just set up a list of string, invoke your browser, go to the page, and then generate the declarations automatically for the current BrowserPage. Here is an example:

    Obviously you will change the name of the filename path but you will find that this generates the same thing as selecting Window Declarations... from the Record menu. You can write a little script that compares this over time so that if you generate another include file (say after a new build) you can do a comparison and see what (if anything) has changed.

    There is also much more scripting logic you can play around with, such as parsing the file to get just the links, etc. But this should give you some idea of where you can go and what you can do.

    Does this help at all?

 

 

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 05:49 AM.

Copyright BetaSoft Inc.