Unable to click on object after browser resize zoom out

i tried to zoom out the web page due to the web design, some buttons located at bottom is not visible at 100% zoom.

the browser resize successfully by below code,
WebUI.executeJavaScript(‘document.body.style.zoom=‘60%’’, null)

but the subsequent test step failed , error
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to click on object

the object repo was designed using selection method attributes. (text + tag)
is this the caused make the test too ‘sensitive’ to the browser zoom view?

any suggestion to avoid the situation if above is the cause?

There is usually more information than that - look for “Caused by”.

However, if you code (or record) tests using typical WebUI methods, it is likely you are altering the coordinate system used to identify some controls. If you use the recorder, then many of your OR references will fail.

WebUI.executeJavaScript("document.body.style.zoom='60%'", null)

My advice: Stick to the default zoom level and don’t alter the AUT from your test.

so best solution, to modify object repo using better selector and object properties?

I don’t know what the best solution is – I don’t know enough about your problem. Your problem seems to be a coord problem. The best way to avoid that is, like I said, not to mess with it.

If you think your OR refs could be better designed, by all means, do what you think might improve them. Clue: I don’t use the OR at all.

i saw error about this, not sure does it caused by the verify element verification failed, or web driver issue?
Caused by: org.openqa.selenium.ElementClickInterceptedException: element click intercepted: Element is not clickable at point (526, 26). Other element would receive the click:

more details about error
Test Case1 FAILED.
Reason:
com.test.unittest.customkeywords.main.TestFacility.TestChangeFacility:51
com.test.unittest.customkeywords.main.TestFacility.invokeMethod:0
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to click on object ‘Object Repository/Facility/button_expand’
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.click(ClickKeyword.groovy:86)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:67)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:616)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$2.call(Unknown Source)
at com.test.unittest.customkeywords.main.TestFacility.TestChangeFacility(TestFacility.groovy:51)
at com.test.unittest.customkeywords.main.TestFacility.invokeMethod(TestFacility.groovy)
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:50)
at Test-2100 - MOD browser zoom.run(Test-2100 - MOD browser zoom:27)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1567090868974.run(TempTestCase1567090868974.groovy:21)
Caused by: org.openqa.selenium.ElementClickInterceptedException: element click intercepted: Element is not clickable at point (526, 26). Other element would receive the click:


(Session info: chrome=76.0.3809.132)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘SSGD2M-00010123’, ip: ‘10.0.75.1’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: com.kms.katalon.selenium.driver.CChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 76.0.3809.132, chrome: {chromedriverVersion: 76.0.3809.68 (420c9498db8ce…, userDataDir: C:\Users\AppData\Lo…}, goog:chromeOptions: {debuggerAddress: localhost:62899}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: 7723ace660463059112d42938760e621
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at com.kms.katalon.selenium.driver.CChromeDriver.execute(CChromeDriver.java:20)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:285)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:84)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.doCall(ClickKeyword.groovy:79)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.call(ClickKeyword.groovy)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
… 20 more

the keyword groovy
package com.test.unittest.customkeywords.main

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.annotation.Keyword
import com.kms.katalon.core.checkpoint.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
import com.kms.katalon.core.testcase.TestCase
import com.kms.katalon.core.testdata.TestData
import com.kms.katalon.core.testobject.TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.test.unittest.customkeywords.utils.TestFacilities
import com.kms.katalon.core.util.KeywordUtil as KeywordUtil
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
import org.openqa.selenium.WebDriver as WebDriver
import org.openqa.selenium.By as By
import org.openqa.selenium.WebElement as WebElement
import org.openqa.selenium.By.ByXPath

import internal.GlobalVariable

public class TestFacility {
TestFacilities facilities = new TestFacilities()

@Keyword
def TestVerifyFacilityElements() {
	WebUI.verifyElementPresent(findTestObject('Facility/button_expand'),5)
	WebUI.click(findTestObject('Facility/button_expand'))
	WebUI.delay(3)
	WebUI.verifyElementPresent(findTestObject('Facility/span_A'),5)
	WebUI.verifyElementPresent(findTestObject('Facility/span_B'),5)
	WebUI.verifyElementPresent(findTestObject('Facility/span_C'),5)
	WebUI.verifyElementPresent(findTestObject('Facility/span_D'),5)
	WebUI.verifyElementPresent(findTestObject('Facility/span_E'),5)
	WebUI.verifyElementPresent(findTestObject('Facility/span_F'),5)
	WebUI.verifyElementPresent(findTestObject('Facility/span_G'),5)
	WebUI.verifyElementPresent(findTestObject('Facility/span_H'),5)
}

@Keyword
def TestChangeFacility(String TestKey) {
	WebUI.switchToDefaultContent()
	WebUI.delay(3)
	WebUI.verifyElementPresent(findTestObject('Facility/button_expand'),5)
	WebUI.click(findTestObject('Facility/button_expand'))
	String test = facilities.getFacilityName(TestKey)
	Object label = WebUI.modifyObjectProperty(findTestObject('Facility/span_emptytest'), 'text', 'equals',test, true)
	WebUI.click(label)
	WebUI.delay(3)
	String expectedHeader = facilities.getCurrentFacility(TestKey)
	Object header =  WebUI.modifyObjectProperty(findTestObject('Facility/button_header'), 'text', 'equals',expectedHeader, true)
	WebUI.verifyElementPresent(header,5)
}

@Keyword
def String TestGetCurrentFacilityKey(String header) {
	/*WebDriver driver = DriverFactory.getWebDriver()
	 DriverFactory.changeWebDriver(driver)
	 String facility = driver.findElement(By.tagName).getText(findTestObject('Facility/button_expand'))
	 String key = facilities.translateHeader(header)
	 KeywordUtil.logInfo("key: "+key)
	 return key*/
}

}

Test Case
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

CustomKeywords.‘com.test.unittest.customkeywords.main.TestFacility.TestChangeFacility’(‘A’)

Katalon is telling you, if you try to click the obeject you’re intending to click, something else would be clicked. This usually means there’s a timing problem:

  1. Maybe you are not waiting long enough for the object to be displayed on the page.
  2. Maybe something else needs to move out of the way.

Try waiting until the target object is visible. Then issue the click step.

WebDriverWait wait = new WebDriverWait(driver, 120);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//span[contains(text(),‘Close’)]")));

returned no such property error.
what should I include?

resolved by changing the objext attribute to add more unique identifier like ID on the pop up form. previous designer just use text.