Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I suppose it depends what you want to do. If you want to compare the bitmap then the <code>CaptureBitmap</code> options should work. If you want to compare the path to the image you can use <code>Image("x").GetROProperty("src")</code>.</p> <p>If you really want to save the <code>src</code> image file then unfortunately QTP doesn't supply a way to interact with the browser's context menu. You can try to use some third-party mechanism to download the image from the <code>src</code> URL (e.g. <a href="http://www.gnu.org/s/wget/" rel="nofollow">wget</a>).</p> <hr> <p><strong>Edit:</strong> I just had another thought, I'm not at work so I can't verify that it will work but I'm pretty sure it will.</p> <p>First cause the context menu to appear, in order to do this you have to change the replay mode to device and run a <code>RightClick</code> operation. </p> <pre><code> replayType = Setting.WebPackage("ReplayType") ' Store old replay mode Setting.WebPackage("ReplayType") = 2 ' change to device replay mode Browser("b").Page("p").Image("I").RightClick Setting.WebPackage("ReplayType") = replayType ' Revert to old mode </code></pre> <p>Then send the letter <kbd>v</kbd> to the browser which will select the <code>Save</code> menu item (on both IE and Firefox) by using the <a href="http://www.advancedqtp.com/2008/04/the-undocumented-devicereplay/" rel="nofollow">device replay object</a></p> <pre><code>Set deviceReplay = CreateObject( “Mercury.DeviceReplay” ) deviceReplay.SendString "v" </code></pre> <p>Now interact with the save dialog as a usual Win32 control.</p> <p><em>Moral:</em> Never underestimate what QTP will let you do if you try hard enough</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload