0

Pleas any one help me I have spend too much time but no luck.

When I perform test case for Export CSV file. I'm getting error as on below:

There was 1 error:

1) Tests\Browser\LoginTest::test_export_qp_list
Facebook\WebDriver\Exception\UnexpectedJavascriptException: javascript error: Ca
nnot read property 'click' of undefined
  (Session info: headless chrome=79.0.3945.88)
  (Driver info: chromedriver=79.0.3945.36 (3582db32b33893869b8c1339e8f4d9ed1816f
143-refs/branch-heads/3945@{#614}),platform=Windows NT 10.0.17763 x86_64)

E:\Portal Files\Laravel-Practise\Dusk Test Cases\Dusk\dusk-query-pages\vendor\fa
cebook\webdriver\lib\Exception\WebDriverException.php:122
E:\Portal Files\Laravel-Practise\Dusk Test Cases\Dusk\dusk-query-pages\vendor\fa
cebook\webdriver\lib\Remote\HttpCommandExecutor.php:331
  1. I have export link with blade code is:
    <a id="export" class="btn btn-outline-primary pull-right text-capitalize mr-2" href="{{url('/qp-export')}}">
        <i class="fa fa-cloud-download"></i>
        Export CSV
    </a>`
  1. And route of this link is:

    Route::get('qp-export', 'HomeController@qpExport')->name('qpExport'); 
  2. Laravel dusk test case code is:

    $this->browse(function (Browser $browser) {
               $browser->visit('/home')
               ->clickLink('#export')
               ->assertStatus(200);
    }); 
Amit Kumar PRO
  • 1,222
  • 2
  • 15
  • 27
Ijaz Ali
  • 128
  • 9

0 Answers0