如何使用phpunit和selenium上传图像?
我尝试使用下面的代码上传图像,测试用例成功执行,但没有上传指定路径的图像。请找到下面的代码,我正在使用ubuntu系统如何使用phpunit和selenium上传图像?,php,image,selenium,automation,phpunit,Php,Image,Selenium,Automation,Phpunit,我尝试使用下面的代码上传图像,测试用例成功执行,但没有上传指定路径的图像。请找到下面的代码,我正在使用ubuntu系统 <?php namespace Tests; use Athena\Athena; use Athena\Test\AthenaBrowserTestCase; use Tests\Browser\Page\GooglePage; use Tests\Browser\Page\LocalFileDetector; class DummyBrowserTest exte
<?php
namespace Tests;
use Athena\Athena;
use Athena\Test\AthenaBrowserTestCase;
use Tests\Browser\Page\GooglePage;
use Tests\Browser\Page\LocalFileDetector;
class DummyBrowserTest extends AthenaBrowserTestCase
{
private $browser;
protected function setUp()
{
$this->browser = Athena::browser(true);
}
public function testGoogle_WaitForElementExistenceAndClick_ShouldShowResultsPage()
{
$this->browser = Athena::browser()->get('https://in.logs.com/');
$this->browser
->find()
->elementWithName('email')
->sendKeys('aaaaaa+552@aaa.com');
$this->browser
->find()
->elementWithName('password')
->sendKeys('aaaa');
$this->browser
->find()
->elementWithXPath('//*[@id="loginform"]/table/tbody/tr[5]/td/button')
->click();
$this->browser
->find()
->elementWithXPath('//a[contains(.,"Add car")]')
->click();
$this->browser
->find()
->elementWithXPath('//a[contains(.,"Browse Files")]')
->click()
->sendKeys("/home/mohan/Desktop/indica.jpg");
$this->browser
->find()
->elementWithXPath('//button[contains(.,"Save")]')
->click();
}
}