Selenium, PHPUnit, and AttachFile() Selenium, PHPUnit, and AttachFile() selenium selenium

Selenium, PHPUnit, and AttachFile()


I had same problem. Then I found this article: http://bitsilearn.blogspot.com/2010/03/selenium-upload-files.html

So instead of using $this->attachFile('file', 'file://test.png') i have used:

$this->type('file', '/path/to/file');

and it works! : )


My bit of experience: path to file must be prefixed with file:// (used on Windows platform).


The code below works. Give it a try.

$this->byName('Name Locator')->value('/home/img/Desert.jpg');$this->byName()->submit();sleep(1);