How to stop automatically closing browser when writing protractor test cases

后端 未结 9 1753
面向向阳花
面向向阳花 2021-02-07 12:43

I am new to writing test cases using protractor for non angular application. I wrote a sample test case.Here the browser closes automatically after running test case.How can I p

9条回答
  •  盖世英雄少女心
    2021-02-07 13:06

    I found Gleeson's solution is working, and that really helped me. The solution was...

    1. Go to %APPDATA%Roaming\npm\node_modules\protractor\built\driverProviders\
    2. Find driverProviders.js
    3. Open it in notepad or any other text editor
    4. Find and Replace return driver.Quit() to return 0
    5. Save the file

    Restart your tests after that.

    I am using node v8.12.0 npm v6.4.1 protractor v5.4.1

    This solution will work, only if you installed npm or protractor globally; if you have installed your npm or protractor locally (in your folder) then, you have to go to your local protractor folder and do the same.

提交回复
热议问题