FAQ
Hi All,
I am new to Selenium. I have given a task for making a
framework with selenium rc and java for our web application.

What I have in my mind is creating different modules or functions for
repetitive tasks like login ,logout , languages (which is a picklist)
and then calling them from other classes.

I am bit confused how to start with this as after login into my web
application there is a page where Admin page which shows all
categories and after clicking them we are taken to a different page
where there are others fields present.



So my question is :
1. Should I create module for all these different pages like
Adminlogin (which will have login info username,password and logout).
2. Then making a test suite module and call all the different page
methods from it.

OR
1. Could i make a separate login and logout etc.But in this case we
have to instantiate selenium rc 2 times for both the methods?

I am bit confused. Could anyone suggest me how to proceed with this? I
have never written a framework before but I want to learn it.

Any help in this regard is appreciated .


Thanks and Regards,
User

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

Search Discussions

  • Mike Riley at May 18, 2012 at 4:20 pm
    First, Selenium RC is deprecated, so you really should be using WebDriver.

    Having said that I will say that I found the Selenium methods much easier
    to learn, so I have been using WebDriverBackedSelenium, which lets you use
    most (but not all) of the Selenium methods as wrappers for WebDriver
    methods. There is some overhead there, but it is tolerable.

    You probably want to look into the PageFactory class. I have not used it
    myself, but it sounds very much like how you were thinking of doing this
    fits into that methodology. I suggest starting a search for other posts
    here and in the webdriver forum to get some ideas on how it can be used. I
    am sure you will find lots of useful posts on it.

    Mike
    On Thursday, May 17, 2012 12:54:22 PM UTC-7, user wrote:

    Hi All,
    I am new to Selenium. I have given a task for making a
    framework with selenium rc and java for our web application.

    What I have in my mind is creating different modules or functions for
    repetitive tasks like login ,logout , languages (which is a picklist)
    and then calling them from other classes.

    I am bit confused how to start with this as after login into my web
    application there is a page where Admin page which shows all
    categories and after clicking them we are taken to a different page
    where there are others fields present.



    So my question is :
    1. Should I create module for all these different pages like
    Adminlogin (which will have login info username,password and logout).
    2. Then making a test suite module and call all the different page
    methods from it.

    OR
    1. Could i make a separate login and logout etc.But in this case we
    have to instantiate selenium rc 2 times for both the methods?

    I am bit confused. Could anyone suggest me how to proceed with this? I
    have never written a framework before but I want to learn it.

    Any help in this regard is appreciated .


    Thanks and Regards,
    User
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/FkqobQ_VO5sJ.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
  • Click click at May 19, 2012 at 11:38 am
    Thanks Mike for the reply.


    On Fri, May 18, 2012 at 12:20 PM, Mike Riley wrote:

    First, Selenium RC is deprecated, so you really should be using WebDriver.

    Having said that I will say that I found the Selenium methods much easier
    to learn, so I have been using WebDriverBackedSelenium, which lets you use
    most (but not all) of the Selenium methods as wrappers for WebDriver
    methods. There is some overhead there, but it is tolerable.

    You probably want to look into the PageFactory class. I have not used it
    myself, but it sounds very much like how you were thinking of doing this
    fits into that methodology. I suggest starting a search for other posts
    here and in the webdriver forum to get some ideas on how it can be used. I
    am sure you will find lots of useful posts on it.

    Mike

    On Thursday, May 17, 2012 12:54:22 PM UTC-7, user wrote:

    Hi All,
    I am new to Selenium. I have given a task for making a
    framework with selenium rc and java for our web application.

    What I have in my mind is creating different modules or functions for
    repetitive tasks like login ,logout , languages (which is a picklist)
    and then calling them from other classes.

    I am bit confused how to start with this as after login into my web
    application there is a page where Admin page which shows all
    categories and after clicking them we are taken to a different page
    where there are others fields present.



    So my question is :
    1. Should I create module for all these different pages like
    Adminlogin (which will have login info username,password and logout).
    2. Then making a test suite module and call all the different page
    methods from it.

    OR
    1. Could i make a separate login and logout etc.But in this case we
    have to instantiate selenium rc 2 times for both the methods?

    I am bit confused. Could anyone suggest me how to proceed with this? I
    have never written a framework before but I want to learn it.

    Any help in this regard is appreciated .


    Thanks and Regards,
    User
    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/FkqobQ_VO5sJ.

    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/selenium-users?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
  • User at May 23, 2012 at 3:08 pm
    Hi All,
    I have written a some code for my framework but getting
    and error.

    I have written a config file (Settings.java) with code :

    package config;


    import com.thoughtworks.selenium.DefaultSelenium;
    import com.thoughtworks.selenium.HttpCommandProcessor;




    public class Settings {

    /*Environment variables*/

    public final String HOST = "localhost";
    public final int PORT = 4444;
    public final String BROWSER = "firefox";
    public final String BASE_URL = "http://12.129.192.196:8080";

    // To set the baseURL and server port

    public final HttpCommandProcessor PROC = new
    HttpCommandProcessor(HOST,PORT,BROWSER,BASE_URL);

    // to create a selenium object for passing as variable

    public final DefaultSelenium selenium = new DefaultSelenium(PROC);

    /* Timeout*/
    public final String TIMEOUT = "60000";

    public final String Admin_PAGETITLE = "eamobile.com - Admin tools
    home";

    public final String Home_PAGETITLE = "eamobile.com - Welcome";
    }
    and a Login class which uses above class


    package modules;
    import config.*;
    import org.junit.*;
    import com.thoughtworks.selenium.*;


    public class Login extends SeleneseTestBase
    {


    // declare a new selenium test

    Settings test = new Settings ();

    @ Test

    public void testsetUp (DefaultSelenium selenium){

    try
    {
    // open,maximize and focus on page.

    selenium.start ();
    selenium.open("/");
    selenium.waitForPageToLoad (test.TIMEOUT);
    selenium.windowMaximize();
    selenium.windowFocus();

    }

    catch (Exception e)

    {

    e.printStackTrace();

    }


    }



    And I am getting initialization error.


    Could anyone else help me with this.


    Also I want a user to login in the site once and perform all the
    test .

    Thanks and Regards

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
  • Mary navis at May 23, 2012 at 4:38 pm
    In RC for selenium instance creation, third argument is *firefox . You
    are using just BROWSER = "firefox";maybe that is causing an error.
    On Wed, May 23, 2012 at 4:08 PM, user wrote:
    Hi All,
    I have written a some code for my framework but getting
    and error.

    I have written a config file (Settings.java) with code :

    package config;


    import com.thoughtworks.selenium.DefaultSelenium;
    import com.thoughtworks.selenium.HttpCommandProcessor;




    public class Settings {

    /*Environment variables*/

    public final String HOST = "localhost";
    public final int PORT = 4444;
    public final String BROWSER = "firefox";
    public final String BASE_URL = "http://12.129.192.196:8080";

    // To set the baseURL and server port

    public final HttpCommandProcessor PROC = new
    HttpCommandProcessor(HOST,PORT,BROWSER,BASE_URL);

    // to create a selenium object for passing as variable

    public final DefaultSelenium selenium  = new DefaultSelenium(PROC);

    /* Timeout*/
    public final String TIMEOUT = "60000";

    public final String Admin_PAGETITLE = "eamobile.com - Admin tools
    home";

    public final String Home_PAGETITLE = "eamobile.com - Welcome";
    }
    and a Login class which uses above class


    package modules;
    import config.*;
    import org.junit.*;
    import com.thoughtworks.selenium.*;


    public class Login extends SeleneseTestBase
    {


    // declare a new selenium test

    Settings test = new Settings ();

    @ Test

    public void testsetUp (DefaultSelenium selenium){

    try
    {
    // open,maximize and focus on page.

    selenium.start ();
    selenium.open("/");
    selenium.waitForPageToLoad (test.TIMEOUT);
    selenium.windowMaximize();
    selenium.windowFocus();

    }

    catch (Exception e)

    {

    e.printStackTrace();

    }


    }



    And I  am getting  initialization error.


    Could anyone else help me with this.


    Also I want a user to login in the site once and perform all the
    test .

    Thanks and Regards

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


    --
    With Thanks and Regards,
    Mary.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
  • Mary navis at May 23, 2012 at 5:16 pm
    This is some framework, am seeing for the first time..And also another
    thing, settings instance is not being used anywhere, maybe instead of
    passing a selenium in your test method you can pass settings object..
    On Wed, May 23, 2012 at 5:37 PM, mary navis wrote:
    In RC for selenium instance creation, third argument is *firefox . You
    are using just  BROWSER = "firefox";maybe that is causing an error.
    On Wed, May 23, 2012 at 4:08 PM, user wrote:
    Hi All,
    I have written a some code for my framework but getting
    and error.

    I have written a config file (Settings.java) with code :

    package config;


    import com.thoughtworks.selenium.DefaultSelenium;
    import com.thoughtworks.selenium.HttpCommandProcessor;




    public class Settings {

    /*Environment variables*/

    public final String HOST = "localhost";
    public final int PORT = 4444;
    public final String BROWSER = "firefox";
    public final String BASE_URL = "http://12.129.192.196:8080";

    // To set the baseURL and server port

    public final HttpCommandProcessor PROC = new
    HttpCommandProcessor(HOST,PORT,BROWSER,BASE_URL);

    // to create a selenium object for passing as variable

    public final DefaultSelenium selenium  = new DefaultSelenium(PROC);

    /* Timeout*/
    public final String TIMEOUT = "60000";

    public final String Admin_PAGETITLE = "eamobile.com - Admin tools
    home";

    public final String Home_PAGETITLE = "eamobile.com - Welcome";
    }
    and a Login class which uses above class


    package modules;
    import config.*;
    import org.junit.*;
    import com.thoughtworks.selenium.*;


    public class Login extends SeleneseTestBase
    {


    // declare a new selenium test

    Settings test = new Settings ();

    @ Test

    public void testsetUp (DefaultSelenium selenium){

    try
    {
    // open,maximize and focus on page.

    selenium.start ();
    selenium.open("/");
    selenium.waitForPageToLoad (test.TIMEOUT);
    selenium.windowMaximize();
    selenium.windowFocus();

    }

    catch (Exception e)

    {

    e.printStackTrace();

    }


    }



    And I  am getting  initialization error.


    Could anyone else help me with this.


    Also I want a user to login in the site once and perform all the
    test .

    Thanks and Regards

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


    --
    With Thanks and Regards,
    Mary.


    --
    With Thanks and Regards,
    Mary.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupselenium-users @
categoriesselenium
postedMay 18, '12 at 12:21p
activeMay 23, '12 at 5:16p
posts6
users3
websiteseleniumhq.org

3 users in discussion

User: 3 posts Mary navis: 2 posts Mike Riley: 1 post

People

Translate

site design / logo © 2022 Grokbase