Selenium: Is there any JS (JavaScript) code coverage tool which we can integrate with Selenium Server/RC

后端 未结 6 551
南方客
南方客 2021-01-01 20:48

Selenium: Is there any JS (JavaScript) code coverage tool which we can integrate with Selenium Server/RC

Hi,

I want to JS code coverage done by my Selenium T

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-01 21:47

    I have found the solution for my need, there are multiple tools available but I want a tool which can be integrated with my existing automation easily

    Tool is JSCover http://tntim96.github.io/JSCover/

    Just run the Server

    1. Run Server java -cp JSCover-all.jar jscover.server.SimpleWebServer . 8080
    2. Run Proxy Server java -jar target/dist/JSCover-all.jar -ws --proxy --port=3128 --report-dir=target

    3. Add Proxy in your Webdriver for port specified, 3128 in my case

    4. After execution of test Generate Reports using

      ((JavascriptExecutor) driver).executeScript("jscoverage_report();");
      

    You can add this line where you exit WebDriver or Test Case

提交回复
热议问题