In our application, based on some input data, an image will be rendered. The images are some charts. As part of our test automation I need to download those charts.
I just have image source url. How can I download the image from the source and save it to disk.
I tried of using different methods and able to download the file. But when I try to open the file, getting a message saying ‘not a valid bitmap file,or its format currently not supported.’
Here is my html
<div id="chart">
<img id="c_12" src="Bonus/ModelChartImage?keys%5B0%5D=UKIrelandEBIT&values%5B0%5D=100&privacyModeServer=False&modelId=Bonus" alt="" usemap="#c_12ImageMap" style="height:300px;width:450px;border-width:0px;" />
<map name="c_12ImageMap" id="c_12ImageMap">
<area shape="rect" coords="255,265,357,266" class="area-map-section" share="Core Bonus" alt="" />
<area shape="rect" coords="128,43,229,265" class="area-map-section" share="Core Bonus" alt="" />
</map>
</div>
Found the answer. We have to set the cookie container from the web site to your request.