I resized the browser & katalon fails to click on the object. Are clicks on elements is always analog & its identified by the co-ordinates? Is there a way i can disable the analog detection of my objects on the web page?
I want the object to be identified with my id & not by relative positions.
Here is the line that fails everytime i resize the window &/or run my scripts in a machine with a different screen resolution
I am having the same issue, the button is on the screen. I have a wait for present and wait for clickable which both pass but still says it’s unclickable at point. I have just added scroll after wait for present and still same issue. I dont’ understand why this one element cannot be clicked.
Hi,
I have the same issue on Jenkins (System user) and on Chrome only. Setting Desired capabilities or maximizing windows does not take effect. Using “Scroll To Element” adds hundreds of code lines to already developed scripts isn’t good solution to the issue. It is not only scroll down; right aligned elements out of-screen as well. Please suggest better solution.
This is a known issue, so you should click on the element using javascript when you can’t do normal click. This should be enclosed in a custom keyword, so below is a sample of its:
import org.openqa.selenium.JavascriptExecutor
import org.openqa.selenium.WebDriver
import org.openqa.selenium.WebElement
import com.kms.katalon.core.annotation.Keyword
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webui.common.WebUiCommonHelper
import com.kms.katalon.core.webui.driver.DriverFactory
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
@Keyword
def clickUsingJS(TestObject to, int timeout) {
try {
WebUI.click(to)
}
catch (Exception e) {
WebDriver driver = DriverFactory.getWebDriver()
WebElement element = WebUiCommonHelper.findWebElement(to, timeout)
JavascriptExecutor executor = ((driver) as JavascriptExecutor)
executor.executeScript('arguments[0].click()', element)
}
throw(e)
}
Thank you. I added the scroll to element & the issue is resolved. Is it possible to update the click keyword in the upcoming releases to include this scenario? Coz, my code now has to include the scroll to element before each click statement?
Hi - my colleague suggested I change my screen resolution down.
I was using a high Res but when I changed to 1366 x 768, suddenly elements were clickable.
Note that they WERE visible and could be identified using Focus for example, but Click consistently failed.
I did not have time to replace Click with JavaScript version… luckily the display change fixed it. Unsure if the Res above is a strict requirement but worth a try.
This is a known issue, so you should click on the element using javascript when you can’t do normal click. This should be enclosed in a custom keyword, so below is a sample of its:
import org.openqa.selenium.JavascriptExecutorimport org.openqa.selenium.WebDriverimport org.openqa.selenium.WebElementimport com.kms.katalon.core.annotation.Keywordimport com.kms.katalon.core.testobject.TestObject as TestObjectimport com.kms.katalon.core.webui.common.WebUiCommonHelperimport com.kms.katalon.core.webui.driver.DriverFactoryimport com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI@Keyworddef clickUsingJS(TestObject to, int timeout) { try { WebUI.click(to) } catch (Exception e) { WebDriver driver = DriverFactory.getWebDriver() WebElement element = WebUiCommonHelper.findWebElement(to, timeout) JavascriptExecutor executor = ((driver) as JavascriptExecutor) executor.executeScript('arguments[0].click()', element) } throw(e)}