Results 1 to 6 of 6
  1. #1

    Selenium Framework


    I'm new to the selenium. My manager asked to me to set up the Selenium framework but i don't know how i need to do?. Currently i started writing selenium scripts using X-path in java.

    Could you please help how do i prepare the framework.

    Thanks in Advance,

  2. #2

    Re: Selenium Framework

    I am assuming you meant you will write testcases with Selenium RC.The following steps are for RC.The approach can be different for each individual as the framework needs are different,but here are some basic things.You might need to adapt according to your needs.

    1)First thing to do is to pick a testing framework in which you would want to wrap your selenium RC tests (e.g JUnit,TestNG or whichever is your favorite.This is not essential,but will go long way in maintenance and continuous integration tasks)

    2)Store your object locators in property files/xml files/excel files again it's your choice

    3)Create a page class which will interact with this objects and have selenium act on it

    4)Your Test Class interacts with this page class to pass test methods.An example would be

    //Test Class

    //Login Page Class
    where usernamelocator is obtained from the property file and so on

    This is how I arrange it
    -----------obj (contains property/xml/excel files for locators)
    -----------src(all test classes and page classes)
    -----------testdata(if your test requires data input)
    -----------util(helper classes like reading property files etc)
    ------------lib(any jar files that you will need)

  3. #3

    Re: Selenium Framework

    Thanks, shahrutvik for your detailed explanation. I have some clarification for the above explanation.

    1) -------------Util: How do we get the utility files or write the utility files.

    2) --------lib: What is the use of jar files.

    Dont hesitate if it's simple questions bcz am not aware all those things.

    Anil babu.

  4. #4

    Re: Selenium Framework

    util files -are actually java files that you will write.This classes will contain methods which may not directly use selenium or test case writing logic,but needed for helper tasks.For e.g if you are storing your objects in property file,you will need a class that will wrap the reading/writing of the properties which your test case class can call.Such methods/classes should go into util.This is a clean separation from actual test cases,so that maintenance is easier in future

    lib files---this are jar files that are needed for compiling of your test case class (e.g selenium-java-client-driver.jar or testng.jar).

    Again the goal of the framework is to separate out logical parts so that maintenance becomes easier.There is nothing that will stop you from not following the above structure,but as you write more testcases,you will notice that you are spending more time in maintenance and hence the above structure.You might need to modify according to your specific needes

  5. #5

    Re: Selenium Framework

    Once again thaks, shahrutvik for your detailed explanation.

  6. #6

    Re: Selenium Framework

    Now I am using a selenium framework named TestAnt which is free, it looks good, can help me to manage/run selenium tests, and finally get a decent report page with logs detail info and screenshot.
    Until now, The disadvantage of TestAnt I found it only support selenium JAVA test.
    I'd like to share the TestAnt download page here:



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 03:47 PM.

Copyright BetaSoft Inc.