18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
How to check position of the image on web page
Hi,
I'm trying to get the location of the image on a web browser but not able to find it.
Also is there any way we can compare the saved image with the real time web page image.
Please help !!
Thanks in advance
I'm trying to get the location of the image on a web browser but not able to find it.
Also is there any way we can compare the saved image with the real time web page image.
Please help !!
Thanks in advance
Comments
acces the image with _image("id"). With ".propertie" you can access a propertie like _image("id").height. When I list the properties of an image (here the _image("_sahi_ignore_7") on http://sahi.example.com/_s_/dyn/Driver_initialized ) it lists:
These attributes should help with the location. But I wouldn't recommend testing the location, the location can easiely change based on the browser, zoom, browser widow size etc.
Regards
Wormi
I'm thinking to use _near or _in or _under API's for locating the image .
But i dont know how to use it in case of a page where there is no "Table " or cell
Can you help me in this?
Let me know to put assertion for the location of the image.
Thanks in advance!!
I use "bySeleniumLocator" to get position (selelnium grid).
Selenium determines Xpath-position, so if ur sure that the image position is fixed, record the position using selenium and use it with sahi.
Regards,
Akshada
_image("2701smallest.jpg")
Thanks in advance!!
Install Selenium RC for your browser, click on the image. From the options provided, select Xpath-position.
Use _bySeleniumLocator("xpath")
Regards,
Akshada
just one doubt whether the location/position will change w.r.t different browser?
I dont think so. Ideally it should not.
Xpath depends on the XML document, so i think it has got nothing to do with Browser.
Regards,
Akshada