I am using PHP and Behat (no mink) with Selenium using Facebook WebDriver. I am working on my last test case which is to upload a local file (image) saved on my computer (using a Mac). How can I upload the file using PHP and Facebook WebDriver?
I get the element of the "upload" button and then the pop up comes to choose the file.
$this>webDriver>setFileDetector(new\Facebook\WebDriver\Remote\LocalFileDetector());
// upload the file and submit the form
$this>webDriver>getKeyboard()>sendKeys("/Users/Guest/Documents/image.jpg/;
But this is not working.
I also get this error :
Fatal error: Uncaught Error: Call to undefined method Facebook\WebDriver\Remote\RemoteWebDriver::setFileDetector() in /Users/Guest/Documents/features/bootstrap/FeatureContext.php:232