I am new to Cognex's in-sight explorer. I am using it for test automation and I want to know is it possible to capture image using a script [preference is python, but other scripting methods are welcome].
  I have my Test Cases [TC] running using python scripts, in case a TC fail I want to capture the camera image at run time and store it on my host PC.
I don't want to use any web came or any thing else. I want to use my existing system of Cognex's Camera and in-sight Explorer.
Look into the In-Sight Native Mode commands.  ASCII native mode commands are sent to the camera over Ethernet on port 23 (telnet).  These commands are documented in the In-Sight Explorer help file which can be accessed from the In-Sight Explorer Help menu.  Look under the 'Communications Reference -> Native Mode Commands' section.
The command RB (Read BMP) will send the current image from the camera in ASCII hexadecimal format.
Using In-Sight Explorer, you can set the cameras trigger mode to 'Continuous' to continuously acquire images, or you can set it to 'Manual' and trigger the camera via a native mode command.  The command to trigger the camera is SE8 (Set event 8).  The camera must be online for either trigger method to work (Sensor menu -> Online).
Automate Image capturing using Cognex's In-sight Explorer