• Whenever any failure comes while running the JS script in web application testing services, it would be good to capture the screenshot of failure point for debugging the issue. Below is the sample code:

    afterTest: function (test) {
            // Ignore if test is passed, otherwise take screenshot and save
            if (test.passed) {
            // Construct file name:
            var timestamp = new Date().toJSON().replace(/:/g, '-');
            var filename = 'TESTFAIL_' + timestamp + '.jpg';
            var filePath = path.join(this.screenshotPath, filename);
            // save screenshot
            console.log('\tSaved screenshot: ', filePath);

    Note: Path where screenshot would be saved should be defined in the config file like:
    screenshotPath: './errorShots/Chrome/',
    Top Software QA Services & Analysis
    Optimize Your Products and Meet Your Launch Deadlines With QASource's Superior Web Application Testing and QA Services. Onboard a Team of Dedicated Q…
This reply was deleted.
    results->result as $result) { ?>
  1. jobtitle;?>
    company;?>(formattedRelativeTime;?>)city;?>, state;?>
    Welcome to Mobile QA Zone, a Next Generation Software Testing Community.Invite your friends to join this community.Write to us to become a featured member.