CodeceptJS icon indicating copy to clipboard operation
CodeceptJS copied to clipboard

Not working on LinkedIn

Open abhisheksoni27 opened this issue 7 years ago • 3 comments

"codeceptjs": "^2.0.4",
"puppeteer": "^1.12.2"
Feature("Login");
Scenario("Login", I => {
  I.amOnPage("https://www.linkedin.com/");
  I.wait(2);

  I.fillField("input#login-email", "XXXXXXXXXXXXX");
  I.wait(2);

  I.fillField("input#login-password", "XXXXXXXXXXXXXX");
  I.wait(2);

  I.click("#login-submit");
});

Output:

Field "input#login-email" was not found by text|CSS|XPath

The same code passes a few times, but most of the times it fails.

abhisheksoni27 avatar Feb 07 '19 09:02 abhisheksoni27

are you sure you wait enough?

kobenguyent avatar Feb 08 '19 14:02 kobenguyent

Yep. Pretty sure.

abhisheksoni27 avatar Feb 09 '19 14:02 abhisheksoni27

you should use Scenario("Login", async (I) => { and await I.wait(2) for this case.

but using I.wait(..) is not the best practice. You should use I.waitForVisible then I.fillField

ngadiyak avatar Feb 13 '19 06:02 ngadiyak