Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8746803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:15:08+00:00 2026-06-13T12:15:08+00:00

In a Jenkins job, I have a windows batch Command build step, which runs

  • 0

In a Jenkins job, I have a windows batch Command build step, which runs a test with phantomJS, like this:

smoke

How can I make the job fail, if inside smokeTest.js I exit phantom with an error, like this:

phantomJS.exit(1)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T12:15:09+00:00Added an answer on June 13, 2026 at 12:15 pm

    Jenkins considers a job as “failed” if the return-code of any command-block
    (like that ‘ExecuteWindows batch command’ above) is non-zero.

    If it does not work for you in this case, it is probably because ‘phantomjs.exe’ returns ‘0’ in any case
    (can confirm this by echo-ing the ERRORLEVEL just after that command: ECHO %ERRORLEVEL% ).

    If this is the case (i.e.: it returns ‘0’ even when fails), you can handle it this way:

    • Print a clear error-message to the console (or STDOUT – something that will show in the log of the Job)
    • Use the Text-finder Plugin to catch that error-message and mark the build as ‘Failed’.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problems with creating a job in jenkins. At the Build step I
I have two scripts in the pre-build step in a Jenkins job, the first
I have a Jenkins build which builds a maven project with -PmyProfile clean package
I have setup jenkin and create a jenkins job to build my maven project,
I have problem with creating constructor, which Jenkins can call for some JSON data
I have installed Jenkins 1.452 as a Windows service and created a job that
I have a Jenkins job which compiles and publishes our Java project to a
If I have job that invokes series of jobs in jenkins can I give
When you have a long running job in Jenkins which is composed of many
I am trying to create a Jenkins job that restarts a program that runs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.