Click on button with Katalon IDE works but not using Katalon studio

Hi all
we are facing an issue on one of our computer.
using IDE, click button works, but when i record and try to click on login button using katalon studio, nothing is happening…

IDE code generated :
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.checkpoint.CheckpointFactory as CheckpointFactory
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testcase.TestCaseFactory as TestCaseFactory
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testdata.TestDataFactory as TestDataFactory
import com.kms.katalon.core.testobject.ObjectRepository as ObjectRepository
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSBuiltInKeywords
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords
import internal.GlobalVariable as GlobalVariable
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS

import com.thoughtworks.selenium.Selenium
import org.openqa.selenium.firefox.FirefoxDriver
import org.openqa.selenium.WebDriver
import com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium
import static org.junit.Assert.*
import java.util.regex.Pattern
import static org.apache.commons.lang3.StringUtils.join

WebUI.openBrowser('https://www.google.com/')
def driver = DriverFactory.getWebDriver()
String baseUrl = "https://www.google.com/"
selenium = new WebDriverBackedSelenium(driver, baseUrl)
selenium.type("id=terminal_containerWindow_login_formElementUsername_coreElementContainer_username", "arnaud")
selenium.click("id=terminal_containerWindow_login_formElementPassword_coreElementContainer_password")
selenium.type("id=terminal_containerWindow_login_formElementPassword_coreElementContainer_password", "test")
selenium.click("id=terminal_containerWindow_login_loginButton_label_labelText_0")

Katalon Studio :

WebUI.openBrowser('')

WebUI.navigateToUrl('https://livebuilds.openbravo.com/retail_pi_pgsql/web/org.openbravo.retail.posterminal/?terminal=VBS-1#login')

WebUI.setText(findTestObject('Object Repository/ob_Temp/input_User_terminal_containerWindow_login_f_dd4da6'), 'test')

WebUI.setEncryptedText(findTestObject('Object Repository/ob_Temp/input_Password_terminal_containerWindow_log_eee0a3'), 'P9ET2sDE0SE=')

WebUI.click(findTestObject('Object Repository/ob_Temp/div_Log In'))

WebUI.waitForPageLoad(30) 

Log :

2020-03-02 18:31:27.526 INFO  c.k.katalon.core.main.TestCaseExecutor   - --------------------
2020-03-02 18:31:27.526 INFO  c.k.katalon.core.main.TestCaseExecutor   - START Test Cases/_openbravo/New Test Case
2020-03-02 18:31:27.714 DEBUG c.k.katalon.core.main.TestCaseExecutor   - Evaluating variables for test case
2020-03-02 18:31:27.747 DEBUG c.k.k.core.context.internal.TestHooker   - STEP beforeTestcase
2020-03-02 18:31:27.747 DEBUG c.k.k.core.context.internal.TestHooker   - Starting invoke 'com.kms.katalon.core.annotation.BeforeTestCase' method: 'TestListener.beforeTestcase(...)'
2020-03-02 18:31:27.747 DEBUG c.k.k.core.context.internal.TestHooker   - Invoke 'com.kms.katalon.core.annotation.BeforeTestCase' method: 'TestListener.beforeTestcase(...)' completed.
2020-03-02 18:31:27.747 TRACE c.k.k.core.context.internal.TestHooker   - END null: beforeTestcase
2020-03-02 18:31:28.060 DEBUG testcase.New Test Case                   - 1: openBrowser("")
2020-03-02 18:31:28.419 DEBUG c.k.k.c.w.k.builtin.OpenBrowserKeyword   - Opening browser
2020-03-02 18:31:28.431 INFO  c.k.k.core.webui.driver.DriverFactory    - Starting 'Chrome' driver
mars 02, 2020 6:31:28 PM org.openqa.selenium.remote.DesiredCapabilities chrome
INFOS: Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
2020-03-02 18:31:28.484 INFO  c.k.k.core.webui.driver.DriverFactory    - Action delay is set to 0 seconds
Starting ChromeDriver 80.0.3987.106 (f68069574609230cf9b635cd784cfb1bf81bb53a-refs/branch-heads/3987@{#882}) on port 40717
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
mars 02, 2020 6:31:31 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFOS: Detected dialect: W3C
2020-03-02 18:31:31.912 INFO  c.k.k.core.webui.driver.DriverFactory    - sessionId = 3dc9eca3eec62146832a6aa89bc8c2fc
2020-03-02 18:31:31.927 INFO  c.k.k.core.webui.driver.DriverFactory    - browser = Chrome 80.0.3987.122
2020-03-02 18:31:31.927 INFO  c.k.k.core.webui.driver.DriverFactory    - platform = Windows 7
2020-03-02 18:31:31.928 INFO  c.k.k.core.webui.driver.DriverFactory    - seleniumVersion = 3.141.59
2020-03-02 18:31:31.928 INFO  c.k.k.core.webui.driver.DriverFactory    - proxyInformation = ProxyInformation{proxyOption=NO_PROXY, proxyServerType=HTTP, password=, proxyServerAddress=, proxyServerPort=0, executionList=}
2020-03-02 18:31:31.934 DEBUG c.k.k.c.w.k.builtin.OpenBrowserKeyword   - ✓ Browser is opened with url: ''
2020-03-02 18:31:31.934 DEBUG testcase.New Test Case                   - 2: navigateToUrl("https://livebuilds.openbravo.com/retail_pi_pgsql/web/org.openbravo.retail.posterminal/?terminal=VBS-1#login")
2020-03-02 18:31:31.960 DEBUG c.k.k.c.w.k.b.NavigateToUrlKeyword       - Checking url
2020-03-02 18:31:31.962 DEBUG c.k.k.c.w.k.b.NavigateToUrlKeyword       - Navigating to 'https://livebuilds.openbravo.com/retail_pi_pgsql/web/org.openbravo.retail.posterminal/?terminal=VBS-1#login'
[1583170292.410][SEVERE]: Timed out receiving message from renderer: 0.100
[1583170292.513][SEVERE]: Timed out receiving message from renderer: 0.100
[1583170292.615][SEVERE]: Timed out receiving message from renderer: 0.100
[1583170292.981][SEVERE]: Timed out receiving message from renderer: 0.100
[1583170293.082][SEVERE]: Timed out receiving message from renderer: 0.100
[1583170293.183][SEVERE]: Timed out receiving message from renderer: 0.100
[1583170293.284][SEVERE]: Timed out receiving message from renderer: 0.100
[1583170293.570][SEVERE]: Timed out receiving message from renderer: 0.100
2020-03-02 18:31:33.756 DEBUG c.k.k.c.w.k.b.NavigateToUrlKeyword       - ✓ Navigate to 'https://livebuilds.openbravo.com/retail_pi_pgsql/web/org.openbravo.retail.posterminal/?terminal=VBS-1#login' successfully
2020-03-02 18:31:33.756 DEBUG testcase.New Test Case                   - 3: setText(findTestObject("Object Repository/ob_Temp/input_User_terminal_containerWindow_login_f_dd4da6"), "test")
2020-03-02 18:31:33.772 DEBUG c.k.k.core.testobject.ObjectRepository   - Finding Test Object 'Object Repository/ob_Temp/input_User_terminal_containerWindow_login_f_dd4da6'
2020-03-02 18:31:33.875 DEBUG c.kms.katalon.core.helper.KeywordHelper  - Checking object
2020-03-02 18:31:33.875 DEBUG c.k.k.c.w.k.builtin.SetTextKeyword       - Checking text
2020-03-02 18:31:33.875 DEBUG c.k.k.c.webui.common.WebUiCommonHelper   - Finding web element from Test Object's properties
2020-03-02 18:31:33.876 DEBUG c.kms.katalon.core.helper.KeywordHelper  - Checking timeout
2020-03-02 18:31:33.876 DEBUG c.k.k.c.webui.common.WebUiCommonHelper   - Finding web element with id: 'Object Repository/ob_Temp/input_User_terminal_containerWindow_login_f_dd4da6' located by 'By.xpath: //input[@id='terminal_containerWindow_login_formElementUsername_coreElementContainer_username']' in '30' second(s)
2020-03-02 18:31:33.877 DEBUG c.k.k.c.webui.common.internal.SmartWait  - Smart Wait Function is triggered
2020-03-02 18:31:37.085 DEBUG c.k.k.c.webui.common.WebUiCommonHelper   - Found 1 web elements with id: 'Object Repository/ob_Temp/input_User_terminal_containerWindow_login_f_dd4da6' located by 'By.xpath: //input[@id='terminal_containerWindow_login_formElementUsername_coreElementContainer_username']' in '30' second(s)
2020-03-02 18:31:37.086 DEBUG c.k.k.c.w.k.builtin.SetTextKeyword       - Clearing text of object 'Object Repository/ob_Temp/input_User_terminal_containerWindow_login_f_dd4da6'
2020-03-02 18:31:37.137 DEBUG c.k.k.c.w.k.builtin.SetTextKeyword       - Setting text of object 'Object Repository/ob_Temp/input_User_terminal_containerWindow_login_f_dd4da6' to value 'test'
2020-03-02 18:31:37.164 DEBUG c.k.k.c.w.k.builtin.SetTextKeyword       - ✓ Text 'test' is set on object 'Object Repository/ob_Temp/input_User_terminal_containerWindow_login_f_dd4da6'
2020-03-02 18:31:37.164 DEBUG testcase.New Test Case                   - 4: setEncryptedText(findTestObject("Object Repository/ob_Temp/input_Password_terminal_containerWindow_log_eee0a3"), "P9ET2sDE0SE=")
2020-03-02 18:31:37.165 DEBUG c.k.k.core.testobject.ObjectRepository   - Finding Test Object 'Object Repository/ob_Temp/input_Password_terminal_containerWindow_log_eee0a3'
2020-03-02 18:31:37.245 DEBUG c.kms.katalon.core.helper.KeywordHelper  - Checking object
2020-03-02 18:31:37.245 DEBUG c.k.k.c.w.k.b.SetEncryptedTextKeyword    - Checking text
2020-03-02 18:31:37.284 DEBUG c.k.k.c.webui.common.WebUiCommonHelper   - Finding web element from Test Object's properties
2020-03-02 18:31:37.284 DEBUG c.kms.katalon.core.helper.KeywordHelper  - Checking timeout
2020-03-02 18:31:37.285 DEBUG c.k.k.c.webui.common.WebUiCommonHelper   - Finding web element with id: 'Object Repository/ob_Temp/input_Password_terminal_containerWindow_log_eee0a3' located by 'By.xpath: //input[@id='terminal_containerWindow_login_formElementPassword_coreElementContainer_password']' in '30' second(s)
2020-03-02 18:31:37.285 DEBUG c.k.k.c.webui.common.internal.SmartWait  - Smart Wait Function is triggered
2020-03-02 18:31:37.548 DEBUG c.k.k.c.webui.common.WebUiCommonHelper   - Found 1 web elements with id: 'Object Repository/ob_Temp/input_Password_terminal_containerWindow_log_eee0a3' located by 'By.xpath: //input[@id='terminal_containerWindow_login_formElementPassword_coreElementContainer_password']' in '30' second(s)
2020-03-02 18:31:37.549 DEBUG c.k.k.c.w.k.b.SetEncryptedTextKeyword    - Clearing text of object 'Object Repository/ob_Temp/input_Password_terminal_containerWindow_log_eee0a3'
2020-03-02 18:31:37.585 DEBUG c.k.k.c.w.k.b.SetEncryptedTextKeyword    - Setting  text of object 'Object Repository/ob_Temp/input_Password_terminal_containerWindow_log_eee0a3' to value ******
2020-03-02 18:31:37.616 DEBUG c.k.k.c.w.k.b.SetEncryptedTextKeyword    - ✓ Text ****** has been set on object 'Object Repository/ob_Temp/input_Password_terminal_containerWindow_log_eee0a3'
2020-03-02 18:31:37.617 DEBUG testcase.New Test Case                   - 5: click(findTestObject("Object Repository/ob_Temp/div_Log In"))
2020-03-02 18:31:37.617 DEBUG c.k.k.core.testobject.ObjectRepository   - Finding Test Object 'Object Repository/ob_Temp/div_Log In'
2020-03-02 18:31:37.723 DEBUG c.kms.katalon.core.helper.KeywordHelper  - Checking object
2020-03-02 18:31:37.723 DEBUG c.k.k.c.webui.common.WebUiCommonHelper   - Finding web element from Test Object's properties
2020-03-02 18:31:37.723 DEBUG c.kms.katalon.core.helper.KeywordHelper  - Checking timeout
2020-03-02 18:31:37.723 DEBUG c.k.k.c.webui.common.WebUiCommonHelper   - Finding web element with id: 'Object Repository/ob_Temp/div_Log In' located by 'By.xpath: //div[@id='terminal_containerWindow_login_loginButton_components']' in '30' second(s)
2020-03-02 18:31:37.723 DEBUG c.k.k.c.webui.common.internal.SmartWait  - Smart Wait Function is triggered
2020-03-02 18:31:37.969 DEBUG c.k.k.c.webui.common.WebUiCommonHelper   - Found 1 web elements with id: 'Object Repository/ob_Temp/div_Log In' located by 'By.xpath: //div[@id='terminal_containerWindow_login_loginButton_components']' in '30' second(s)
2020-03-02 18:31:37.970 DEBUG c.kms.katalon.core.helper.KeywordHelper  - Checking timeout
2020-03-02 18:31:37.970 DEBUG c.k.k.c.w.keyword.builtin.ClickKeyword   - Clicking on object: 'Object Repository/ob_Temp/div_Log In'
2020-03-02 18:31:38.009 DEBUG c.k.k.c.w.keyword.builtin.ClickKeyword   - Trying Selenium click !
2020-03-02 18:31:39.077 DEBUG c.k.k.c.w.keyword.builtin.ClickKeyword   - Trying to scroll to the element and use Selenium click !
2020-03-02 18:31:40.408 DEBUG c.k.k.c.w.keyword.builtin.ClickKeyword   - Trying to scroll the element and use Context click !
2020-03-02 18:31:40.590 DEBUG c.k.k.c.w.keyword.builtin.ClickKeyword   - ✓ Object: 'Object Repository/ob_Temp/div_Log In' is clicked on
2020-03-02 18:31:40.591 TRACE c.k.katalon.core.main.TestCaseExecutor   - END null: click(findTestObject("Object Repository/ob_Temp/div_Log In"))
2020-03-02 18:31:40.592 DEBUG c.k.katalon.core.main.TestCaseExecutor   - ✓ Test Cases/_openbravo/New Test Case
2020-03-02 18:31:40.596 DEBUG c.k.k.core.context.internal.TestHooker   - STEP afterTestcase
2020-03-02 18:31:40.596 DEBUG c.k.k.core.context.internal.TestHooker   - Starting invoke 'com.kms.katalon.core.annotation.AfterTestCase' method: 'TestListener.afterTestcase(...)'
2020-03-02 18:31:40.634 DEBUG c.k.k.c.w.k.builtin.CloseBrowserKeyword  - Closing browser
2020-03-02 18:31:41.299 DEBUG c.k.k.c.w.k.builtin.CloseBrowserKeyword  - ✓ Browser is closed
2020-03-02 18:31:41.300 DEBUG c.k.k.core.context.internal.TestHooker   - Invoke 'com.kms.katalon.core.annotation.AfterTestCase' method: 'TestListener.afterTestcase(...)' completed.
2020-03-02 18:31:41.301 TRACE c.k.k.core.context.internal.TestHooker   - END null: closeBrowser()
2020-03-02 18:31:41.302 TRACE c.k.k.core.context.internal.TestHooker   - END null: afterTestcase
2020-03-02 18:31:41.303 INFO  c.k.katalon.core.main.TestCaseExecutor   - END Test Cases/_openbravo/New Test Case

Tks in advance for your help

Your code navigates to:
https://livebuilds.openbravo.com/retail_pi_pgsql/web/org.openbravo.retail.posterminal/?terminal=VBS-1#login

When I tried, the page took nearly 20 seconds to load. I had to wait long before I touch the page. Same applies to your code. Your code should wait enough seconds after calling WebUI.navigateToURL(...) and before calling WebUI.setText(findTestObject(..),...).

Then how you can wait appropriate seconds? There are many post concerning that issue. Start tracing them with this:

Thank you for your help @kazurayam.
yes , first load is quite long, i updated the code as bellow, but getting same result. Click seems not to be done

WebUI.openBrowser('')

WebUI.navigateToUrl('https://livebuilds.openbravo.com/retail_pi_pgsql/web/org.openbravo.retail.posterminal/?terminal=VBS-1#login')
WebUI.waitForPageLoad(30)

WebUI.setText(findTestObject('Object Repository/ob_Temp/input_User_terminal_containerWindow_login_f_dd4da6'), 'test')
WebUI.waitForPageLoad(30)

WebUI.setEncryptedText(findTestObject('Object Repository/ob_Temp/input_Password_terminal_containerWindow_log_eee0a3'), 'P9ET2sDE0SE=')
WebUI.waitForPageLoad(30)

WebUI.waitForElementClickable(findTestObject('Object Repository/ob_Temp/div_Log In'), 60)
WebUI.click(findTestObject('Object Repository/ob_Temp/div_Log In'))
WebUI.waitForPageLoad(30)

i also tryied using this code

> WebElement elementToClick  = driver.findElement(By.id('terminal_containerWindow_login_loginButton_label_labelText_0'));
> def psize = elementToClick.getSize()
> int getTopLeftY = (elementToClick.getSize().getHeight()) - (elementToClick.getSize().getHeight()/2);
> int getTopLeftX =  (elementToClick.getSize().getWidth()) - (elementToClick.getSize().getWidth()/2);
> Actions userAction = new Actions(driver);
> userAction.moveToElement(elementToClick, getTopLeftX, getTopLeftY).click().perform();

Resulting with the error

mars 03, 2020 11:26:09 AM org.openqa.selenium.interactions.Actions moveToElement
INFOS: When using the W3C Action commands, offsets are from the center of element

But what i don’t understand is that using IDE it is working fine, and really quickly, but using Studio’s code on Machine A works, but not working on machine B. We have the same version of Katalong & Chrome Driver.

Tks again for your help.

@arnaud.cognard

You wrote that the following code on Katalon IDE successfully clicked the button.

selenium.click("id=terminal_containerWindow_login_loginButton_label_labelText_0")

Then it would be safe to say that the following XPath expression can select the target element (Login button):

//*[@id="terminal_containerWindow_login_loginButton_label_labelText_0"]

On the other hand you wrote that the following line on Katalon Studio did NOT click the button.

WebUI.click(findTestObject('Object Repository/ob_Temp/div_Log In'))

What locator(xpath) the Test Object Object Repository/ob_Temp/div_Log In has?

I suppose that the locator (xpath) used in Katalon Studio is different from the one used in Katalon IDE. Different locators work differently, of course.

hello,
well,
actually i have these informations :

where selector is
//*[@id = 'terminal_containerWindow_login_loginButton_label_labelText_0' and (text() = 'Log In' or . = 'Log In')]

when i try
WebUI.waitForElementClickable(findTestObject(‘Object Repository/ob_Temp/Btn_Log In’), 60)
WebUI.click(findTestObject(‘Object Repository/ob_Temp/Btn_Log In’), 60)

first line works but when clicking, chrome crashes.
2020-03-04 12:43:04.278 ERROR c.k.katalon.core.main.TestCaseExecutor - :x: Test Cases/_openbravo/New Test Case (1) FAILED.
Reason:
groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click() is applicable for argument types: (com.kms.katalon.core.testobject.TestObject, java.lang.Integer) values: [TestObject - ‘Object Repository/ob_Temp/Btn_Log In’, 60]
Possible solutions: click(com.kms.katalon.core.testobject.TestObject), click(com.kms.katalon.core.testobject.TestObject, com.kms.katalon.core.model.FailureHandling), check(com.kms.katalon.core.testobject.TestObject), check(com.kms.katalon.core.testobject.TestObject, com.kms.katalon.core.model.FailureHandling), back(), wait()
at New Test Case (1).run(New Test Case (1):62)
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 TempTestCase1583322162292.run(TempTestCase1583322162292.groovy:23)

many tks.

The following message tells you the cause of failure:

You have the following line.

There is a small mistake here.

Please change to:

WebUI.click(findTestObject(‘Object Repository/ob_Temp/Btn_Log In’))

The 2nd argument to the click() can not be an integer. See the doc:

Wouh !!! what a mistake :).

ok, but this does not solve the issue.

2020-03-04 17:07:16.519 DEBUG c.k.k.c.webui.common.WebUiCommonHelper   - Finding web element with id: 'Object Repository/ob_Temp/Btn_Log In' located by 'By.xpath: //*[@id = 'terminal_containerWindow_login_loginButton_label_labelText_0' and (text() = 'Log In' or . = 'Log In')]' in '30' second(s)
2020-03-04 17:07:16.519 DEBUG c.k.k.c.webui.common.internal.SmartWait  - Smart Wait Function is triggered
2020-03-04 17:07:16.743 DEBUG c.k.k.c.webui.common.WebUiCommonHelper   - Found 1 web elements with id: 'Object Repository/ob_Temp/Btn_Log In' located by 'By.xpath: //*[@id = 'terminal_containerWindow_login_loginButton_label_labelText_0' and (text() = 'Log In' or . = 'Log In')]' in '30' second(s)
2020-03-04 17:07:16.744 DEBUG c.kms.katalon.core.helper.KeywordHelper  - Checking timeout
2020-03-04 17:07:16.744 DEBUG c.k.k.c.w.keyword.builtin.ClickKeyword   - Clicking on object: 'Object Repository/ob_Temp/Btn_Log In'
2020-03-04 17:07:16.753 DEBUG c.k.k.c.w.keyword.builtin.ClickKeyword   - Trying Selenium click !
2020-03-04 17:07:17.802 DEBUG c.k.k.c.w.keyword.builtin.ClickKeyword   - Trying to scroll to the element and use Selenium click !
2020-03-04 17:07:18.992 DEBUG c.k.k.c.w.keyword.builtin.ClickKeyword   - Trying to scroll the element and use Context click !
2020-03-04 17:07:19.126 DEBUG c.k.k.c.w.keyword.builtin.ClickKeyword   - ✓ Object: 'Object Repository/ob_Temp/Btn_Log In' is clicked on

I really have no more idea now …

Hi all
this works !

WebUI.executeJavaScript("document.getElementById('terminal_containerWindow_login_loginButton_label_labelText_0').click();", null)

but why ??

Clicking element by JavaScript is sometimes better than by WebUI.click — it is known issue as the following post says.

I have a guess. When I looked at your Application Under Test at https://livebuilds.openbravo.com/retail_pi_pgsql/web/org.openbravo.retail.posterminal/?terminal=VBS-1#login , I noticed that the “Login” button changes its color when I move mouse over it. The color of the button changes in a sophisticated (complicated) manner.


What’s going on the “Login” button?

I looked at the source code of the HTML using Google Chrome’s DevTool. I found that the “Login” button is controlled by JavaScript framework (named “enyo”?), and the HTML structure around the button is very complexed. It is likely that the DOM of the page is dynamically manipulated by the JS framework.

I guess, test case script have to move cursor over the Login button before it calls “WebUI.click()”. That is the way a human does when he clicks the button. It is likely that the framework expects the mouse should be over the button before the click event fired; in other words, without the cursor over the button, WebUI.click() may fail firing the click event. I mean, WebDriver is disturbed operating on the page by the JavaScript framework.

On the other hand, the following code stays effective:

WebUI.executeJavaScript("document.getElementById('terminal_containerWindow_login_loginButton_label_labelText_0').click();", null)

Possibly this javascript call is not disturbed by the framework because it can directly identify the element and fire the click event on it.