Skip to content

@dataProvider with selenium #304

Open
@jessicakryan

Description

@jessicakryan

Hi,
Just wondering if anyone can help me. I am trying to run a Login test using the dataProvider annotation (my current set up is below). The test runs as expected and fills out the username and password fields correctly, however the output shows that the test failed with the following error message
testLoginFail with data set #1() does not exist. If anyone can help me out with this, it would be much appreciated.

/**
 * Constructor - initialise the web driver session
 */ 

public function __construct($name = NULL, array $data = array(), $dataName = '') {
parent::__construct($name, $data, $dataName);
...
/**
* Tests the unsuccessful login of a user
* @dataProvider userDataProvider
*/
public function testLoginFail($email, $password) {
//Create objects required by this test
$userAction = new UserAction($this);

    //Perform login action
    $userAction->endUserLogin($email, $password);

}

public function userDataProvider() {
return array(
array('afakeemail@gmail.com', 'Password'),
array('anotheremail@gmail.com', 'Password')
);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions