no js files listed in the summary tab
-
- Posts: 2
- Joined: 2008-04-18 9:12 pm
no js files listed in the summary tab
Hello:
I have the same issue that no JS files are listed in the summary tab. View Page Source, i don't see /* automatically generated by JSCoverage - do not edit */.
I tried to copy all js files to the same location as jscoverage.htm file location.
For sure that my JS files are executed for our application which I want to test with.
Thanks for your help.
Jason
I have the same issue that no JS files are listed in the summary tab. View Page Source, i don't see /* automatically generated by JSCoverage - do not edit */.
I tried to copy all js files to the same location as jscoverage.htm file location.
For sure that my JS files are executed for our application which I want to test with.
Thanks for your help.
Jason
-
- Site Admin
- Posts: 34
- Joined: 2007-05-26 5:25 am
Re: no js files listed in the summary tab
Hello Jason,
I should clarify that the "/* automatically generated by JSCoverage - do not edit */ " should be in the script files - jscoverage does not modify the HTML files. Are you viewing the source of the .html files or the .js files?
I should clarify that the "/* automatically generated by JSCoverage - do not edit */ " should be in the script files - jscoverage does not modify the HTML files. Are you viewing the source of the .html files or the .js files?
-
- Posts: 2
- Joined: 2008-04-18 9:12 pm
Re: no js files listed in the summary tab
Hello:
I saw the /* automatically generated by JSCoverage - do not edit */ when I open the generated js files after executed >jscoverage SOURCE_DIR DEST_DIR.
SOURCE_DIR = mydomain/path/jsfolder
DEST_DIR=mydomain/path where our application will start with.
I could open and run my application from our domain. i.e.: http://mydomain:1234/path/jscoverage.html?logon.jsp. Our application is launched and shows in your iframe. I login to our app and click around to execute our JS functions. Then I click the summary tab, there is not js files listed.
Executed js files for our application is a subfolder of our domain path, such as mydomain/path/jsfolder.
Not sure I miss any step.
Thanks.
Jason
I saw the /* automatically generated by JSCoverage - do not edit */ when I open the generated js files after executed >jscoverage SOURCE_DIR DEST_DIR.
SOURCE_DIR = mydomain/path/jsfolder
DEST_DIR=mydomain/path where our application will start with.
I could open and run my application from our domain. i.e.: http://mydomain:1234/path/jscoverage.html?logon.jsp. Our application is launched and shows in your iframe. I login to our app and click around to execute our JS functions. Then I click the summary tab, there is not js files listed.
Executed js files for our application is a subfolder of our domain path, such as mydomain/path/jsfolder.
Not sure I miss any step.
Thanks.
Jason
-
- Site Admin
- Posts: 34
- Joined: 2007-05-26 5:25 am
Re: no js files listed in the summary tab
Okay, so the instrumentation step is working ...odjs wrote:Hello:
I saw the /* automatically generated by JSCoverage - do not edit */ when I open the generated js files after executed >jscoverage SOURCE_DIR DEST_DIR.
If you look at the script from within your browser, is the code instrumented? That is, if you access http://mydomain:1234/path/jsfolder/script.js in your browser, do you get the instrumented code? (An easier way to check for this is to use Firefox and Firebug and to use Firebug's "Script" tab. See http://siliconforks.com/doc/debugging-javascript/ for other alternatives.)
That doesn't sound quite right - generally you want to use the same path structure for the instrumented code as for the original code, so the instrumented code replaces the original code. For example, if the source code of your web application is arranged as described in http://tomcat.apache.org/tomcat-6.0-doc ... ource.html, you would run something like this:odjs wrote: SOURCE_DIR = mydomain/path/jsfolder
DEST_DIR=mydomain/path where our application will start with.
Code: Select all
jscoverage web build
Code: Select all
jscoverage web/path build/path
Re: no js files listed in the summary tab
where should *jscoverage.js and *.jscoverage.html be located? our JS folder? or our domain folder, the same as our logon.jsp folder?
From user guide, the SOURCE_DIR is our JS files location for jscoverage to copy all existing js files and instrument them for js coverage to use.
our folder structure:
domain logon page: \\webapp\logon.jsp
js files: \\webapp\jsfolder\*.js
How do I do for SOURCE_DIR and DEST_DIR?
Should I do: jscoverage web build as jscoverage webapp webapp\jsfolder?
I only want to instrument the js code unser \\webapp\jsfolder. How do I run jscoverage and its parameters?
Thanks.
Jason
From user guide, the SOURCE_DIR is our JS files location for jscoverage to copy all existing js files and instrument them for js coverage to use.
our folder structure:
domain logon page: \\webapp\logon.jsp
js files: \\webapp\jsfolder\*.js
How do I do for SOURCE_DIR and DEST_DIR?
Should I do: jscoverage web build as jscoverage webapp webapp\jsfolder?
I only want to instrument the js code unser \\webapp\jsfolder. How do I run jscoverage and its parameters?
Thanks.
Jason
-
- Site Admin
- Posts: 34
- Joined: 2007-05-26 5:25 am
Re: no js files listed in the summary tab
The JS folder. For every JavaScript file x.js, you should see a file x.js.jscoverage.js (and x.js.jscoverage.html) in the same folder as x.js.Guest wrote:where should *jscoverage.js and *.jscoverage.html be located? our JS folder? or our domain folder, the same as our logon.jsp folder?
No, you need to have a build folder (DEST_DIR) which is totally distinct from your source folder. The jscoverage program copies an entire folder, and all its subfolders, recursively, instrumenting any .js files. The destination folder should not be a subfolder of the source folder - if you did that, running "jscoverage webapp webapp\jsfolder", you would end up with something like this:Guest wrote:From user guide, the SOURCE_DIR is our JS files location for jscoverage to copy all existing js files and instrument them for js coverage to use.
our folder structure:
domain logon page: \\webapp\logon.jsp
js files: \\webapp\jsfolder\*.js
How do I do for SOURCE_DIR and DEST_DIR?
Should I do: jscoverage web build as jscoverage webapp webapp\jsfolder?
Code: Select all
webapp\logon.jsp
webapp\jsfolder\
webapp\jsfolder\script.js (original JavaScript code)
webapp\jsfolder\logon.jsp (!)
webapp\jsfolder\jsfolder\ (this is surely not what you want)
webapp\jsfolder\jsfolder\script.js (instrumented JavaScript code)
webapp\jsfolder\jsfolder\script.js.jscoverage.js
You should be doing something like
Code: Select all
jscoverage webapp webapp2
First, before you run jscoverage, create the build folder (e.g., webapp2\). Then runGuest wrote:I only want to instrument the js code unser \\webapp\jsfolder. How do I run jscoverage and its parameters?
Code: Select all
jscoverage webapp\jsfolder webapp2\jsfolder
This will create the jscoverage.html file in webapp2\jsfolder. That should not cause problems, but it makes the URL to access your logon page slightly more complicated: it will look something like
Code: Select all
http://mydomain:1234/path/jsfolder/jscoverage.html?../logon.jsp
Re: no js files listed in the summary tab
Why we have to copy logon.jsp and other files and folders from "webapp" folder to "webapp2" folder? After that we have all apps structure in webapp2 and run our web application from webapp2 folder? That will not work since there are some security path are configured in web server to map to "webapp" folder.
Why I could not copy all instrumented *.jscoverage.js and *.jscoverage.html files to our original jsfolder and run url like this: http://mydomain:1234/webapp/jsfolder/js ... /logon.jsp? I tried it and does not work.
I tried to create "webapp2" folder as some level of our "webapp" folder and copy every over from webapp to webapp2. Then I could not use http://mydomain:1234/webapp2/jsfolder/jscoverage.html to test opening jscoverage page. Because webapp2 is not mapped as our web application folder.
our web folder structure is:
apps/webapp/logon.jsp and other files. subfolders
apps/webapp/1.0/jscripts/*.js
our url:
http://mydomain:1234/apps/logon.jsp
webapp is mapped as default folder.
if I create webapp2 as apps/webapp2. And run jscoverage webapp/1.0/jsfolder webapp2/1.0/jsfolder, instrumented js and html files are created.
Then I could not lunch webapp2/1.0/jsfolder/jscoverage.html from our domain because webapp2 is not our default folder.
Both URL like this does not work: http://mydomain:1234/apps/1.0/jsfolder/jscoverage.html or http://mydomain:1234/apps/webapp2/1.0/j ... erage.html
In order to access to instrumented jscoverage.html from our domain entry, the build dir (DEST_DIR) have to be under our "webapp" folder.
For example:
create folder: apps/webapp/jscoverage/1.0/jsfolder
Then run: jscoverage webapp/1.0/jsfolder webapp/jscoverage/1.0/jsfolder
Instrumented files are created.
The URL http://mydomain:1234/apps/jscoverage/1/ ... /logon.jsp could run our application. However, no JS files are shown in summary tab.
Why I could not copy all instrumented *.jscoverage.js and *.jscoverage.html files to our original jsfolder and run url like this: http://mydomain:1234/webapp/jsfolder/js ... /logon.jsp? I tried it and does not work.
I tried to create "webapp2" folder as some level of our "webapp" folder and copy every over from webapp to webapp2. Then I could not use http://mydomain:1234/webapp2/jsfolder/jscoverage.html to test opening jscoverage page. Because webapp2 is not mapped as our web application folder.
our web folder structure is:
apps/webapp/logon.jsp and other files. subfolders
apps/webapp/1.0/jscripts/*.js
our url:
http://mydomain:1234/apps/logon.jsp
webapp is mapped as default folder.
if I create webapp2 as apps/webapp2. And run jscoverage webapp/1.0/jsfolder webapp2/1.0/jsfolder, instrumented js and html files are created.
Then I could not lunch webapp2/1.0/jsfolder/jscoverage.html from our domain because webapp2 is not our default folder.
Both URL like this does not work: http://mydomain:1234/apps/1.0/jsfolder/jscoverage.html or http://mydomain:1234/apps/webapp2/1.0/j ... erage.html
In order to access to instrumented jscoverage.html from our domain entry, the build dir (DEST_DIR) have to be under our "webapp" folder.
For example:
create folder: apps/webapp/jscoverage/1.0/jsfolder
Then run: jscoverage webapp/1.0/jsfolder webapp/jscoverage/1.0/jsfolder
Instrumented files are created.
The URL http://mydomain:1234/apps/jscoverage/1/ ... /logon.jsp could run our application. However, no JS files are shown in summary tab.
-
- Site Admin
- Posts: 34
- Joined: 2007-05-26 5:25 am
Re: no js files listed in the summary tab
The point is you must have separate source and deployment (also called build) folders. The jscoverage program replaces your JavaScript files with instrumented versions. If jscoverage worked by doing everything in one folder, it would clobber your original JS source files, and then they're gone forever!Guest wrote:Why we have to copy logon.jsp and other files and folders from "webapp" folder to "webapp2" folder? After that we have all apps structure in webapp2 and run our web application from webapp2 folder? That will not work since there are some security path are configured in web server to map to "webapp" folder.
If you need to have "webapp\" be your deployment folder, that's fine; but then you need a separate source folder, say, "src\", and run jscoverage like this:
Code: Select all
jscoverage src webapp
Code: Select all
jscoverage src\jsfolder webapp\jsfolder
That could work, but it's error-prone and I recommend against it - there are a lot of files you need to copy, and you need to be careful to preserve the exact folder and subfolder structure or things will break. You would need to copy all the following files:Guest wrote:Why I could not copy all instrumented *.jscoverage.js and *.jscoverage.html files to our original jsfolder and run url like this: http://mydomain:1234/webapp/jsfolder/js ... /logon.jsp? I tried it and does not work.
Code: Select all
jsfolder\jscoverage.html
jsfolder\jscoverage.css
jsfolder\jscoverage.js
jsfolder\jscoverage-throbber.gif
jsfolder\jscoverage-sh_main.js
jsfolder\jscoverage-sh_javascript.js
jsfolder\jscoverage-sh_nedit.css
jsfolder\*.js.jscoverage.html
jsfolder\*.js.jscoverage.js
jsfolder\subfolder\*.js.jscoverage.html (if you have any subfolders in jsfolder\)
jsfolder\subfolder\*.js.jscoverage.js
This is getting really complicated - as I noted above, if your web server has to run from "webapp\" and you can't change that, then I would create a separate source folder and use "webapp\" (or "webapp\jsfolder\") as your DEST_DIR.Guest wrote: I tried to create "webapp2" folder as some level of our "webapp" folder and copy every over from webapp to webapp2. Then I could not use http://mydomain:1234/webapp2/jsfolder/jscoverage.html to test opening jscoverage page. Because webapp2 is not mapped as our web application folder.
our web folder structure is:
apps/webapp/logon.jsp and other files. subfolders
apps/webapp/1.0/jscripts/*.js
our url:
http://mydomain:1234/apps/logon.jsp
webapp is mapped as default folder.
if I create webapp2 as apps/webapp2. And run jscoverage webapp/1.0/jsfolder webapp2/1.0/jsfolder, instrumented js and html files are created.
Then I could not lunch webapp2/1.0/jsfolder/jscoverage.html from our domain because webapp2 is not our default folder.
Both URL like this does not work: http://mydomain:1234/apps/1.0/jsfolder/jscoverage.html or http://mydomain:1234/apps/webapp2/1.0/j ... erage.html
In order to access to instrumented jscoverage.html from our domain entry, the build dir (DEST_DIR) have to be under our "webapp" folder.
For example:
create folder: apps/webapp/jscoverage/1.0/jsfolder
Then run: jscoverage webapp/1.0/jsfolder webapp/jscoverage/1.0/jsfolder
Instrumented files are created.
The URL http://mydomain:1234/apps/jscoverage/1/ ... /logon.jsp could run our application. However, no JS files are shown in summary tab.
Re: no js files listed in the summary tab
Yes. I tried to create a sub folder as DEST_DIR as "apps\webapp\jscoverage\1.0\jsfolder". Then run jscoverage apps\webapp\1.0\jsfolder apps\webapp\jscoverage\1.0\jsfolder.This is getting really complicated - as I noted above, if your web server has to run from "webapp\" and you can't change that, then I would create a separate source folder and use "webapp\" (or "webapp\jsfolder\") as your DEST_DIR.
All files: jscoverage.*, *.jscoverage.js, and *.jscoverage.html are created.
our jsfolder is very simple. Only have some js files, no sub folder there.
Launch url:
http://mydomain:1234/apps/jscoverage/1. ... /logon.jsp
The application loaded and application itself is working fine within your iframe. However, after some testing and click the Summary tab, there is not js file loaded.
-
- Site Admin
- Posts: 34
- Joined: 2007-05-26 5:25 am
Re: no js files listed in the summary tab
But using a subfolder of your web server directory will not work, because it modifies the URLs of script files within your web application.Guest wrote: Yes. I tried to create a sub folder as DEST_DIR as "apps\webapp\jscoverage\1.0\jsfolder". Then run jscoverage apps\webapp\1.0\jsfolder apps\webapp\jscoverage\1.0\jsfolder.
All files: jscoverage.*, *.jscoverage.js, and *.jscoverage.html are created.
Here you are accessing the login page atGuest wrote: our jsfolder is very simple. Only have some js files, no sub folder there.
Launch url:
http://mydomain:1234/apps/jscoverage/1. ... /logon.jsp
The application loaded and application itself is working fine within your iframe. However, after some testing and click the Summary tab, there is not js file loaded.
Code: Select all
http://mydomain:1234/apps/logon.jsp
You MIGHT be able to get this to work IF your web application uses nothing but relative URLs: you can copy the file logon.jsp, and all the rest of the files and subfolders in your web application, to the folder "apps\webapp\jscoverage\". Then access the logon page with the URL
Code: Select all
http://mydomain:1234/apps/jscoverage/1.0/jsfolder/jscoverage.html?../../logon.jsp
(note that this uses ../../logon.jsp instead of ../../../logon.jsp)
Re: no js files listed in the summary tab
I finally make it work for our application.
Great tool!
Thanks.
Jason
Great tool!
Thanks.
Jason