Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to find the Code coverage of a web application hosted by IIS server through JScover #174

Closed
vipindubey84 opened this issue Jan 5, 2015 · 6 comments
Assignees
Labels

Comments

@vipindubey84
Copy link

Hi All,

I have to get the coverage of devlopment code(Java script) through our UI automated scripts written in c# (Selenium WebDriver) for an web application hosted via an IIS server.

Can you please guide me in this regards.

@tntim96 tntim96 self-assigned this Jan 5, 2015
@tntim96
Copy link
Owner

tntim96 commented Jan 6, 2015

There are two basic techniques:

  1. Pre-instrument the JavaScript with JSCover file-mode before running your tests
  2. Configure your tests to run through JSCover in proxy mode

The first option can be more reliable and will work over SSL (JSCover can't proxy SSL requests). There is an example of the basic technique here in the examples.

@tntim96 tntim96 closed this as completed Jan 6, 2015
@vipindubey84
Copy link
Author

Hi Team,
It is really very great to have your fast response. I really appreciate it.

I have followed the first option suggested by you.I am listing the steps which i followed to instrument java script code.

  1. First i installed web application which need to tested(After installing it all .js files get stored in some folder say Build)
  2. Now i ran StartServer.bat which instrumented the ,js files under Build Folder.

As per my understanding, JSCover work with instrumented file so i replaced the Build Folder(Original .JS files) content with the generated instrumented file.

Since the web application runs the java scripts inside build folder so if i am putting the instrumented file instead of actual java script files, My Web application is only not launching.

Please find the image of StartServer.bat attached.
startserver

@tntim96
Copy link
Owner

tntim96 commented Jan 6, 2015

It looks like you're using an old version (0.2.3). The latest is 1.0.16

@vipindubey84
Copy link
Author

Hello Team...

Please see the steps which i am performing for JScoverage server file mode. Please suggest if i am doing something wrong.

1)My web page is served by IIS server as "https://localhost" and all js files are residing at location c:\inetpub\wwwroot after installing the application Setup.

2)By usiing JScover file server method if i take all jScode(code inside thsese folder--c:\inetpub\wwwroot) and instrument it to some other loaction(Say Jscover Folder structuctre as per your example) and try launching my web page "https://localhost" the web page is opening but there is no coverage shown.

  1. since step 2 was not giving coverage, so i took the generated instrumented files from instrumented folder and replaced it with c:\inetpub\wwwroot. but in this case my webpage "https://localhost" itself is not opening.

Please guide me if i am making anything wrong here.
I need to implement the coverage for my project.

I tried using Proxy method but it doesnot work:(
Can i use Proxy method for Https Web pages????

@vipindubey84
Copy link
Author

Hello Team...

Please see the steps which i am performing for JScoverage server file mode. Please suggest if i am doing something wrong.

1)My web page is served by IIS server as "https://localhost" and all js files are residing at location c:\inetpub\wwwroot after installing the application Setup.

2)By usiing JScover file server method if i take all jScode(code inside thsese folder--c:\inetpub\wwwroot) and instrument it to some other loaction(Say Jscover Folder structuctre as per your example) and try launching my web page "https://localhost" the web page is opening but there is no coverage shown.

  1. since step 2 was not giving coverage, so i took the generated instrumented files from instrumented folder and replaced it with c:\inetpub\wwwroot. but in this case my webpage "https://localhost" itself is not opening.

Please guide me if i am making anything wrong here.
I need to implement the coverage for my project.

I tried using Proxy method but it doesnot work:(
Can i use Proxy method for Https Web pages????

@tntim96
Copy link
Owner

tntim96 commented Jan 8, 2015

i took the generated instrumented files from instrumented folder and replaced it with c:\inetpub\wwwroot

That's correct.

in this case my webpage "https://localhost" itself is not opening

Can you check the following:

  1. Does jscover.log contain any errors after instrumenting the files?
  2. When you load the page, do you get any JavaScript errors?

Can i use Proxy method for Https Web pages?

Not currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants