SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    Apr 2004
    Location
    California
    Posts
    292
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Selenium not launching application

    Guys,

    I'm new to Selenium. Selenium launches FF but it does not lauch our web application within the browser. Because it is not launching the application it failing with errors saying "Element userName not found". Can someone please help, below is my setUp code:

    public void setUp() {

    DefaultSelenium browser = new DefaultSelenium("localhost",4444,"*firefox","https ://qaadomrcmain114112.rcqa25.com");

    browser.start();
    browser.windowMaximize();
    browser.windowFocus();

  2. #2
    Member
    Join Date
    Dec 2009
    Posts
    30
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selenium not launching application

    public void setUp() throws Exception {
    String url = "https:your url";

    setUp(url, "*firefox");

    }

    this is all you need,if this not work you have to change the proxy setting in fire fox

  3. #3
    Senior Member
    Join Date
    Jan 2007
    Posts
    147
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selenium not launching application

    Look into the "open" command. Dont have it in front of me right now.

  4. #4
    Moderator
    Join Date
    Sep 2001
    Location
    Yankee Land
    Posts
    4,055
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selenium not launching application

    The default command looks right, though its been awhile since I have used it...although when it says Element Username not found, what line is it pointing to? I don't see anything that references that in the code snippet you provided.
    - M

    Nothing learns better than experience.

    "So as I struggle with this issue I am confronted with the reality that noting is perfect."
    - Unknown

    Now wasting blog space at QAForums Blogs - The Lookout

  5. #5
    Member
    Join Date
    Apr 2004
    Location
    California
    Posts
    292
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selenium not launching application

    hi michaelf,

    Here is my entire code:

    import junit.framework.TestCase;
    import com.thoughtworks.selenium.*;

    public class SanityTestCase extends TestCase {



    public Selenium browser;



    public void setUp() throws Exception {



    browser = new DefaultSelenium("localhost",4444,"*firefox","https ://someurl.com");

    browser.start();

    browser.windowMaximize();
    browser.windowFocus();


    }

    public void testLogin(){

    try {

    browser.waitForPageToLoad("30000");
    browser.type("userName", "qaautorcmain114112");
    browser.type("passWord", "abcd1234");
    browser.click("signInButton1.text");
    System.out.println("This is the TRY code");


    } catch (Exception e) {
    System.out.println("The test case failed because: " +e);

    } finally {

    System.out.println("This is the finally code");
    browser.type("userName", "qaautorcmain114112");
    browser.type("passWord", "abcd1234");
    browser.click("signInButton1.text");

    }


    }



    public void teardown() {

    browser.stop();
    browser.close();

    }

    public static void main(String [] args)
    {
    SanityTestCase browser1 = new SanityTestCase();
    browser1.setUp();
    browser1.testLogin();


    }

  6. #6
    Member
    Join Date
    Apr 2004
    Location
    California
    Posts
    292
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selenium not launching application

    [ QUOTE ]
    public void setUp() throws Exception {
    String url = "https:your url";

    setUp(url, "*firefox");

    }

    this is all you need,if this not work you have to change the proxy setting in fire fox

    [/ QUOTE ]

    Hi tbull. the call which you are making for setup method " setUp(url, "*firefox");" should I do this from Main method?

  7. #7
    Senior Member
    Join Date
    Jan 2007
    Posts
    147
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selenium not launching application

    Michael's correct, your default command is fine.

    I would remove the waitforFrame to load and the rest from setup and add it to testlogin.

    add
    browser.open("your url") as the first line in testlogin

  8. #8
    Member
    Join Date
    Apr 2004
    Location
    California
    Posts
    292
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selenium not launching application

    OMG.... TTK you are a life saver man.. This finally worked. I got frustrated and almost gave up on Selenium.. But now I can make more progress.. Really appreciate everyone's help here.

    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 9.68%
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 12:50 AM.

Copyright BetaSoft Inc.