Element with xpath not found.

I am using CodeCeption to test a website for work. I have never used CodeCeption, and I'm just trying to run my first test. I just want to login, but my login box uses jQuery UI (which means the login button has no identifier). Website https://moveyourmountain.org

I used this in the Chome console:

$x('//button/span[text()="Login"]')

and got this answer:

[<span class=​"ui-button-text">​Login​</span>​]

so my xpath is right, and picks the right thing. However, in CodeCeption, I have the following:

$I = new AcceptanceTester($scenario);
$I->wantTo('Login as a regular user.');
$I->amOnPage('/');
$I->click('LOGIN');
$I->fillField('email', 'some@one.com');
$I->fillField('password', 'test123');
$I->click(['xpath' => '//button/span[text()="Login"]']);
$I->see('MY ACCOUNT');

and every time I run it, I get this in my terminal:

Sorry, I couldn't click {"xpath":"//button/span[text()="Login"]"}:
Element with xpath '//button/span[text()="Login"]' was not found on page.

Scenario Steps:
5. I click {"xpath":"//button/span[text()="Login"]"}
4. I fill field "password","test123"
3. I fill field "email","some@one.com"
2. I click "LOGIN"
1. I am on page "/"

I use PhpBrowser if that matters. Any help is appreciated. I have no idea how to check this, because it obviously does not solve the same thing as chrome.

+4
1

accept.suite.yml.

PhpBrowser WebDriver.

+1

Source: https://habr.com/ru/post/1546370/


All Articles