Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用phpunit和selenium上传图像?_Php_Image_Selenium_Automation_Phpunit - Fatal编程技术网

如何使用phpunit和selenium上传图像?

如何使用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

我尝试使用下面的代码上传图像,测试用例成功执行,但没有上传指定路径的图像。请找到下面的代码,我正在使用ubuntu系统

<?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(); 
    }
}