SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Mar 2011
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Dynamic selenium scripts

    Hi,

    I need to make my selenium scripts dynamic (small changes on the application or different server response times never make my scripts fail). Would you please suggest some scripting methods so that I can achieve this?

    Note :Am using Junit(Remote Control) scripts for testing.


    thanks in advance,
    --Regards--
    Finoob M K
    SPI Mysore.

  2. #2
    SQA Knight
    Join Date
    May 2006
    Location
    Playa Del Rey, California, United States
    Posts
    2,592
    Post Thanks / Like
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Dynamic selenium scripts

    The key is only use record and playback as a reference, not as actual code you use.

    To avoid wait time issues, use configurable time outs, and intelligent waits, whether it's a wait method, or if you need to poll for the object. For every action you perform, make sure you get a response back before continuing. Like if you click a submit button, wait till the button is either depressed or the browser is loading the next page before continuing.

    To avoid problems in object recognition. Try to use stable properties. I believe the Selenium developers recommend using CSS selectors as those are the same set of properties the UI designer will use to create their style sheets, or name/id selectors as that's what a backend dev would use to identify the object. XPATH is generally frowned upon as depending on how it's written it can be fragile (for simple path selection queries) or become resource intensive (for more complicated queries).

    Also use Page objects when possible. It'll make the code easier to maintain.
    David Lai
    SDET / Consultant
    LinkedIn profile

  3. #3
    Member
    Join Date
    Jul 2011
    Location
    Bangalore, India
    Posts
    42
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dynamic selenium scripts

    Develop your own framework using JUnit which has the following properties:

    1. Configurable using external properties file
    2. Should wait some time if the object is not loaded
    3. Should generate useful results
    4. Parametrized using some external means (i.e. Excel, XML, database, etc)
    5. Selenium 2.0 WebDriver provides APIs for page objects, utilizing these generate reliable tests

    Thanks,

 

 

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 03:48 PM.

Copyright BetaSoft Inc.