I want to make a script in which i just give the location where image is present and it will return the source of image which can be compared with actual value.
Asked
Active
Viewed 285 times
2 Answers
0
If I understand what you are asking, such thing is impossible in Selenium. Selenium interacts with the page DOM and can't detect page contents based on location.
If you want to verify image existence, there are appropriate ways to do so. You have to find it using various locators available in Selenium and then you can run an isDisplayed()
query on it for example.

Eugene S
- 6,709
- 8
- 57
- 91
0
Check this out:
open | http://hello.com
storeEval | window.document.getElementById('folio').getAttribute('src') | source
echo | ${source}
So it is possible to get source of the image using javascript. But you need to find element using javascript not just location.
If you will provide an HTML code of your page (part with image) or page address I will add code that will fit your needs.

Antesser
- 669
- 4
- 5