Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

seeInField finds the element, while fillField doesn't - CodeCeption

I am totally new to CodeCeption. I have the below html inside the body,

<div><input type="text" name="content_id" id="contentId" maxlength="10" value="123"></div>

In CodeCeption acceptance test I have a this below code

`<?php 
$I = new AcceptanceTester($scenario);
$I->wantTo('fillfield test');
$I->amOnPage('/');
$I->seeInField('#contentId', 123);
$I->fillField('#contentId', 222397);
?>`

seeInField Test passes successfully, but fillField throws an error

Sorry, I couldn't fill field "#contentId", 222397
InvalidArgumentException: The current node list is empty

This stops me to proceed further. Help me out on this.

like image 507
Kamalakannan J Avatar asked Jun 22 '14 08:06

Kamalakannan J


People also ask

Does Codeception use selenium?

Codeception is very flexible framework that you can use to write your Selenium tests.

What is Codeception selenium?

Codeception can be classified as a tool in the "Testing Frameworks" category, while Selenium is grouped under "Browser Testing". Selenium is an open source tool with 14.9K GitHub stars and 4.97K GitHub forks. Here's a link to Selenium's open source repository on GitHub.


1 Answers

Finally got answer to my own question. I used PhpBrowser module for testing, it won't allow the user to fill fields which are not inside the form. And other stuffs they mentioned in the Docs are,

Common PhpBrowser drawbacks:

  1. You can click only on links with valid urls or form submit buttons
  2. You can't fill fields that are not inside a form
  3. You can't work with JavaScript interactions: modal windows, datepickers, etc.,
like image 99
Kamalakannan J Avatar answered Sep 27 '22 20:09

Kamalakannan J