# Scroll to Position - How to find x and y co-ordinates?

**URL:** <https://forum.katalon.com/t/scroll-to-position-how-to-find-x-and-y-co-ordinates/40700>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [March 5, 2020, 5:00am UTC](https://forum.katalon.com/t/scroll-to-position-how-to-find-x-and-y-co-ordinates/40700 "2020-03-05T05:00:59Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![helpdesk](https://avatars.discourse-cdn.com/v4/letter/h/7c8e57/32.png) [@helpdesk](https://forum.katalon.com/u/helpdesk)\
**Post date:** [March 5, 2020, 8:10pm UTC](https://forum.katalon.com/t/scroll-to-position-how-to-find-x-and-y-co-ordinates/40700/2 "2020-03-05T20:10:03Z")

</div>

Sorry, but this sounds more like a homework assignment than testing a browser page. The “problem” with X and Y would be the page size, the screen resolution and others. Setting the page to maximum (like below) will set page size. Otherwise, bring up the code Inspect and look in the corner at your settings for your web page, then try some tests estimates less than the max less the insets.

WebUI.maximizeWindow()

Another method to get the highlighted cell is to create a table and move through the column, row by row, breaking when you have the value you want (unless your assignment states specifically). Tables and moving through them are discussed in other tutorials and questions, such as:

[https://docs.katalon.com/katalon-studio/docs/handle\_web\_tables.html#example-1you-want-to-get-a-text-from-a-web-table-and-verify-it](https://docs.katalon.com/katalon-studio/docs/handle_web_tables.html#example-1you-want-to-get-a-text-from-a-web-table-and-verify-it)

> [@Trying to find object by Xpath "How to handle Web Tables"](http://forum.katalon.com/t/trying-to-find-object-by-xpath-how-to-handle-web-tables/20086/8):
>
> Hey @Brandon_Hein that worked great! Now Katalon can identify the table. However now the problem is work with the inside table (tr) because Katalon don´t fill the list: List\<WebElement\> Rows = Table.findElements(By.tagName('tr')) I´m working based on this example: [Handle web tables with Katalon Studio](https://docs.katalon.com/katalon-studio/tutorials/handle_web_tables.html#handle-web-tables-with-katalon-studio)

Once you have the specific column WebElement, you can use, getLocation() that returns a Point object, which gives you the X and Y position,

‘get the x position of the sixth column’  
int spotX = myColumns.get(5).getLocation().getX();  
‘get the y position of the sixth column’  
int spotY = myColumns.get(5).getLocation().getY();

or use, getRect() that returns the upper left X and Y, as well as the height and width of the cell.

Just a note that you may need a fudge factor added to the X and subtracted from the Y. The X and Y are the corner positions. If you want to ensure you are inside the cell, then you need the fudge factor added/subtracted from the starting position.

---

_[View the full topic](https://forum.katalon.com/t/scroll-to-position-how-to-find-x-and-y-co-ordinates/40700)._
