# (Moved) Couldnt locate object after zoom out the webpage

**URL:** <https://forum.katalon.com/t/moved-couldnt-locate-object-after-zoom-out-the-webpage/26294>\
**Category:** Web Testing\
**Tags:** web-testing, katalon-studio\
**Created:** [May 27, 2019, 8:02am UTC](https://forum.katalon.com/t/moved-couldnt-locate-object-after-zoom-out-the-webpage/26294 "2019-05-27T08:02:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anitha](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anitha](https://forum.katalon.com/u/anitha)\
**Post date:** [May 27, 2019, 8:02am UTC](https://forum.katalon.com/t/moved-couldnt-locate-object-after-zoom-out-the-webpage/26294/1 "2019-05-27T08:02:46Z")

</div>

Hi,  
Im a newbie,

I used the zoom out using the script below and changed the web page zoom level as 80%.

WebUI.executeJavaScript(‘document.body.style.zoom= '80%'’, null)

After that, whatever i recorded earlier are throwing error as “unable to click on object”.  
I tried saving object selector by Xpath and Attributes .But it didnt work

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint  
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase  
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData  
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject  
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint  
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW  
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile  
import com.kms.katalon.core.model.FailureHandling as FailureHandling  
import com.kms.katalon.core.testcase.TestCase as TestCase  
import com.kms.katalon.core.testdata.TestData as TestData  
import com.kms.katalon.core.testobject.TestObject as TestObject  
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS  
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI  
import internal.GlobalVariable as GlobalVariable

WebUI.openBrowser(‘’)

WebUI.waitForElementVisible(findTestObject(‘Page\_datahub/div\_GO SMART GO MOBILITY (1) (1)’), 20)

WebUI.executeJavaScript(‘document.body.style.zoom= '80%'’, null)

WebUI.click(findTestObject(‘Page\_datahub/a\_Sign In (10) (1)’))

WebUI.click(findTestObject(‘Page\_datahub Sign In/button\_Sign In (1)’))

WebUI.delay(3, FailureHandling.STOP\_ON\_FAILURE)

Kindly help me out to proceed with zoom out level

---

<div class="post-metadata">

**Author:** ![Manu\_Mahendran](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/manu_mahendran/32/23869_2.png) [@Manu\_Mahendran](https://forum.katalon.com/u/Manu_Mahendran)\
**Post date:** [May 27, 2019, 11:46am UTC](https://forum.katalon.com/t/moved-couldnt-locate-object-after-zoom-out-the-webpage/26294/2 "2019-05-27T11:46:10Z")

</div>

Seems like the page is going to mobile mode(RWD) when you zoom out and hence the Xpaths are changing. Infact, what you are doing is effectively equal to changing screensize.  
try setting the resolution using  
driver.manage().window().setSize(new Dimension(1530,818))

OR you can use the following link to zoom in and zoomout

> **[How To Zoom In And Zoom Out Browser In Selenium WebDriver | Software Testing...](https://www.softwaretestingmaterial.com/zoom-in-and-zoom-out-in-selenium/)**
>
> We all know Selenium automates browsers. When we are running selenium scripts, sometimes we may face a situation where we need to perform zoom in and zoom out. In Selenium, this can be easily achieved. In this article, I will show you two methods on...

---

<div class="post-metadata">

**Author:** ![albert.vu](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/albert.vu/32/20595_2.png) [@albert.vu](https://forum.katalon.com/u/albert.vu)\
**Post date:** [August 8, 2022, 7:48am UTC](https://forum.katalon.com/t/moved-couldnt-locate-object-after-zoom-out-the-webpage/26294/3 "2022-08-08T07:48:52Z")

</div>

Archived on August 8, 2022, 7:48am UTC


