Page 1 of 1

Selenium RC with Java & TestNG

Posted: 2011-09-26 6:01 am
by phanib78
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

Re: Selenium RC with Java & TestNG

Posted: 2012-06-07 10:52 pm
by tessarakt
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();