SimpleTest PHP Scriptable Web Browser does not work on input type email

158 Views Asked by At

I am trying to use the PHP Scriptable Web Browser from simplest.org to automatically fill-in a form on a website.

The email field in the form is set to:

<input id="mail1" type="email" name="mail1">

etc.

If I try to fill in this email-field with:

$browser->setField('mail1', '[email protected]');

Nothing happens !!! (the filed stays blank, no problems with other fields where the type="text").

Is there a workaround for this "new" email field so I can still use the PHP Scriptable Web Browser?

I really would like to auto-fill in a form and submit it using PHP.

2

There are 2 best solutions below

0
Jesper Koot On

I actually solved it by using CURL in PHP. There are some very good and interesting video's about that on YouTube.

Thnx all!!

0
Tama On

You should edit tag.php and add the following line in class SimpleTagBuilder, function createInputTag:

            'email' => 'SimpleTextTag',

For example you can put it here:

            ...
            'text' => 'SimpleTextTag',
            'email' => 'SimpleTextTag',
            'hidden' => 'SimpleTextTag',
            ...

However, this tool is not updated any more. Maybe it's better to use another tool, for example Selenium: https://github.com/php-webdriver/php-webdriver