Selenium RC with Java & TestNG

Questions, problems, suggestions, bug reports, and so on.
Post Reply
phanib78
Posts: 1
Joined: 2011-09-26 5:54 am

Selenium RC with Java & TestNG

Post by phanib78 » 2011-09-26 6:01 am

Hi
I am using Selenium with Java and TestNG. Wanted to run some code coverage using JSCoverage.

Will be really great if someone can help me with the steps to run the same.

Thanks in advance

tessarakt
Posts: 3
Joined: 2012-06-07 10:24 pm

Re: Selenium RC with Java & TestNG

Post by tessarakt » 2012-06-07 10:52 pm

I'm not sure if I completely understand what you are trying to do.

But I basically followed http://mercenary-code.blogspot.de/2010/ ... enium.html (translated to Java). It works so far, I don't know anything about TestNG though.

HTH,
Jens

P.S.: The JS snippet has a bug, and can be greatly simplified. This works for me:

Code: Select all

if (! window.jscoverage_report) {
  window.jscoverage_report = function (dir) {
    if(window._$jscoverage == undefined) return "";
    json = JSON.stringify(window._$jscoverage);

    return json;
  };
};
return window.jscoverage_report();

Post Reply