2

Selenium opens browser and loads page, then stops.

I have inherited a selenium project with no internal documentation and I'm a bit stuck on how to get it up and running (I am new to Selenium). We've gotten to a point where the program will open up an instance of firefox and load up the correct URL, but it never appears to even attempt to log in.

We're running Selenium 2.26.0 and Firefox 18.0.2.

My test suite is as follows (I've shortened the package and import directories for privacy):

package pro.selenium.testSuites;

import org.jbehave.core.annotations.UsingSteps;
import org.junit.Test;

import pro.automation.annotations.AutomationAnnotations.PageObjects;
import pro.automation.annotations.AutomationAnnotations.StoryPath;
import pro.selenium.pageObjects.PageExecutiveDashboard;
import pro.selenium.pageObjects.PageExecutiveOverallExpansion;
import pro.selenium.pageObjects.PageLogin;
import pro.selenium.pageObjects.PageTeamDriverStatistics;
import selenium.steps.LoginSteps;

@UsingSteps(instances={LoginSteps.class})
@PageObjects(list={PageLogin.class, PageExecutiveDashboard.class, PageTeamDriverStatistics.class, PageExecutiveOverallExpansion.class})
@StoryPath(path="Login.story")
public class LoginTest extends WebStories {

    @Test
    public void test(){}

}

The story is here:

Scenario: TC1241: Log In - Blank User Name and Password Error
Given I am on the Login page
When I click the Login button
Then I validate the Error text contains "Username is a required field."
And I validate the Error text contains "Password is a required field."
And I validate the User Name textfield is ""
And I validate the Password textfield is ""

When I run it all, the console shows only the following and then stops. On the browser itself there is never any change.

Scenario: TC1241: Log In - Blank User Name and Password Error
Given I am on the Login page

Any ideas of what I could be missing here?

3
  • Is this Java? With... JCuke? Have you tried running a debugger to see if the code in the step definition gets executed? Commented Jun 6, 2014 at 16:39
  • I am not familiar with JCuke. I've debugged it and it hung up on a program and didn't show the source code (I'm using eclipse). If you stop the program the error "Jun 6, 2014 11:06:58 AM org.openqa.selenium.internal.seleniumemulation.WaitForPageToLoad handleSeleneseCommand WARNING: Cannot determine whether page supports ready state. Abandoning wait." comes into the console.
    – MikeyH
    Commented Jun 6, 2014 at 17:08
  • My bad, you marked it with JBehave, not JCuke Commented Jun 6, 2014 at 17:57

3 Answers 3

1

Please verify that LoginSteps.class has implementation of Given I am on the Login page step.

0

I would recommend you to move your Selenium version and drivers for your other browsers (IE,Chrome) to the latest version. So far 2.44. Verify Selenium and drivers from browsers are same version and also check according to your US (32 bits, 64 bits)

0

It looks like you are missing story steps, if this is based on JBehave then you need to exactly match the step definition in the story/feature file and to that in the java story steps. Even an extra space at the end can cause the step to be marked pending.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.