How to add snapshot in HTML file, which is not path dependent
Using QTP-11, I have created a result file, where in the file for each step I am adding snapshot for that step. when I am opening that HTML file and clicking on the snapshot snapshot is getting opened. as of now no issues - but If I cut the folder and keeping it in some other location trying to open the snapshot it's unable to open. Firstly i understood the path which I am giving it's trying to search that location only but how to change it so that if I change the path or machine It should work.
It would be really great if I get some idea to resolve it.
I'm guessing, since it broke when you moved the html, that you're saving the snapshot files locally. That likely means you're using a relative path to point to the snapshots. It would help to see the HTML, so I can tell you exactly what needs changing, but I'll tell you the basics of what you need...
In order to fix this issue, you'll have to move the snapshot files to a location that can be reached by any machine where you'd view the HTML. Then you'll have to change your relative paths into absolute paths.
you can define your path at the time of creation, or if you are storing this path dynamically then you can replace the path after the file creation.
Yes as Venu said, use a dynamic path as i dont think we have a way to embed files in HTML other than linking them and if you are linking them you would have to carry all your artifacts with that HTML file