Accordion section collapses immediately after clicking – how to keep it open for dropdown selection?

Hi all,

I’m working on a Katalon Studio test case for a form in our UWA Apply portal. There’s an accordion section titled:
<h3 class="accordion-list-title">Personal details – Additional questions *</h3>
Clicking it reveals some dropdowns like “Select answer” fields. However, during test execution, the accordion collapses immediately after expanding, making it impossible to select values from the dropdowns.

Here’s what I’m trying:

WebUI.click(findTestObject('Page_Apply/accordion_PersonalDetails')) // to expand
WebUI.selectOptionByIndex(findTestObject('Page_Apply/dropdown_SingleCover'), 1)

But it fails at the dropdown selection — probably because the accordion is no longer visible or interactable.

What I’ve tried so far :

  • Using delays and waitForElementVisible before interacting with the dropdown.
  • Trying scrollToElement on the accordion or dropdown.
  • Confirmed that clicking the accordion manually does reveal the dropdowns in the browser.

Questions :

  1. How do I keep the accordion open long enough for the next dropdown interaction?
  2. Is there a better way to ensure the dropdown remains visible/interactable during automation?

Any help or workaround would be appreciated!

*********************************Xpath Details as below ****************
Element : select_Select answerSingle Type Cover (cove_4e7451

xpath : //select[@id=‘ApplicationServiceQuestions[37].MultichoiceServiceQuestionAnswer’]

accordion : h3_Personal details Additional questions _

xpath : //h3[(text() = ‘Personal details – Additional questions *’ or . = ‘Personal details – Additional questions *’)]

*********FULL CODE OF THE Test case as below ****************************



ErrorKatalon6May.log (306.1 KB)

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 static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject

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.testng.keyword.TestNGBuiltinKeywords as TestNGKW

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 com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows

import internal.GlobalVariable as GlobalVariable

import org.openqa.selenium.Keys as Keys

import org.openqa.selenium.support.ui.Select as Select

import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory

//<<<<<<<<<<<<<<<<< Personal Details >>>>>>>>>>>>>>>>>>>>>

WebUI.click(findTestObject(‘PersonalDetails/Page_Apply The University of Western Australia/h3_Personal details _’))

WebUI.setText(findTestObject(‘PersonalDetails/Page_Apply The University of Western Australia/input_UWA Student ID’), ‘0312345678’)

WebUI.click(findTestObject(‘PersonalDetails/Page_Apply The University of Western Australia/button_Save_PersonalDetails’))

WebUI.click(findTestObject(‘PersonalDetails/Page_Apply The University of Western Australia/h3_Address details _’))

WebUI.click(findTestObject(‘PersonalDetails/Page_Apply The University of Western Australia/button_Save_AddressDetails’))

WebUI.click(findTestObject(‘PersonalDetails/Page_Apply The University of Western Australia/h3_Personal details Additional questions _’))

WebUI.delay(5)

WebUI.selectOptionByIndex(findTestObject(‘PersonalDetails/Page_Apply The University of Western Australia/select_Select answerSingle Type Cover (cove_4e7451’),

1)/>

1 Like

to resolve the accordion collapse issue and interact with the dropdown in Katalon Studio:

1. Use JavaScript Click for Accordion

Avoid potential event interference by directly triggering the click via JavaScript:

TestObject accordion = findTestObject('Page_Apply/accordion_PersonalDetails')
WebUI.executeJavaScript('arguments[0].scrollIntoView(true);', [accordion])
WebUI.executeJavaScript('arguments[0].click();', [accordion])

2. Add Explicit Waits for Visibility/Interactivity

Wait for the dropdown to be fully rendered before interacting:

TestObject dropdown = findTestObject('Page_Apply/dropdown_SingleCover')

// Wait for dropdown to be interactable
WebUI.waitForElementVisible(dropdown, 10)
WebUI.waitForElementClickable(dropdown, 10)

// Select option
WebUI.selectOptionByIndex(dropdown, 1)

3. Verify Accordion State

Add a check to confirm the accordion is open:

String accordionClass = WebUI.getAttribute(accordion, 'class')
if (!accordionClass.contains('active')) { // Adjust class name based on your UI
    WebUI.click(accordion)
}

4. Retry Mechanism

Handle flaky behavior with a retry loop:

int maxAttempts = 3
int attempts = 0

while (attempts < maxAttempts) {
    try {
        WebUI.click(accordion)
        WebUI.selectOptionByIndex(dropdown, 1)
        break
    } catch (Exception e) {
        attempts++
        WebUI.waitForPageLoad(5)
    }
}

5. Full Modified Code

// Expand accordion using JavaScript
TestObject accordion = findTestObject('Page_Apply/accordion_PersonalDetails')
TestObject dropdown = findTestObject('Page_Apply/dropdown_SingleCover')

// Scroll and click with JS
WebUI.executeJavaScript('arguments[0].scrollIntoView({behavior: "smooth", block: "center"});', [accordion])
WebUI.executeJavaScript('arguments[0].click();', [accordion])

// Wait for dropdown to stabilize
WebUI.waitForElementPresent(dropdown, 10)
WebUI.waitForElementClickable(dropdown, 10)

// Select option
WebUI.selectOptionByIndex(dropdown, 1)

6. Alternative: Use XPath for Dynamic Elements

If the dropdown is dynamically added to the DOM, use direct XPath targeting:

TestObject dynamicDropdown = new TestObject().addProperty('xpath', ConditionType.EQUALS, 
  '//select[@id="ApplicationServiceQuestions[37].MultichoiceServiceQuestionAnswer"]')
WebUI.waitForElementPresent(dynamicDropdown, 10)
WebUI.selectOptionByValue(dynamicDropdown, 'your-value')

Key Fixes

  • JavaScript Execution: Bypasses Selenium’s native click if event listeners interfere.
  • Explicit Waits: Ensures elements are interactable before actions.
  • Accordion State Check: Prevents “collapsed” state during interaction.

Troubleshooting

  • Animation Delays: Add a small delay after expanding the accordion:
WebUI.delay(1) // 1 second for CSS transitions

I noticed that you are trying to choose “Personal Details”. Maybe there are none available. Perhaps you have to determine there are some first before you try to select one.

WebUI.verifyElementVisible(findTestObject('PersonalDetails/Page_Apply TUWA/select_Select answerSingle Type Cover (cove_4e7451'))

numItems =  WebUI.getNumberOfTotalOption(findTestObject('PersonalDetails/Page_Apply TUWA/select_Select answerSingle Type Cover (cove_4e7451'))
if (numItems >= 1) {
    WebUI.selectOptionByIndex(findTestObject('PersonalDetails/Page_Apply TUWA/select_Select answerSingle Type Cover (cove_4e7451'), 1)
}

Do you know if you have dynamic references?
select_Select answerSingle Type Cover (cove_4e7451

And maybe:
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

import org.openqa.selenium.Keys as Keys

import internal.GlobalVariable as GlobalVariable


//<<<<<<<<<<<<<<<<< Personal Details >>>>>>>>>>>>>>>>>>>>>
WebUI.waitForElementVisible(findTestObject('PersonalDetails/Page_ApplyTUWA/h3_Personal details'), 10)

WebUI.verifyElementVisible(findTestObject('PersonalDetails/Page_ApplyTUWA/h3_Personal details'))

WebUI.verifyElementVisible(findTestObject('PersonalDetails/Page_ApplyTUWA/input_UWA Student ID'))
WebUI.setText(findTestObject('PersonalDetails/Page_ApplyTUWA/input_UWA Student ID'), '0312345678')
WebUI.verifyElementAttributeValue(findTestObject('PersonalDetails/Page_ApplyTUWA/input_UWA Student ID'), 'value', '0312345678', 10)

WebUI.verifyElementVisible(findTestObject('PersonalDetails/Page_ApplyTUWA/button_Save_PersonalDetails'))
WebUI.click(findTestObject('PersonalDetails/Page_ApplyTUWA/button_Save_PersonalDetails'))
WebUI.waitForPageLoad(10)

WebUI.waitForElementVisible(findTestObject('PersonalDetails/Page_ApplyTUWA/h3_Address details'), 10)
WebUI.verifyElementVisible(findTestObject('PersonalDetails/Page_ApplyTUWA/h3_Address details'))

WebUI.verifyElementVisible(findTestObject('PersonalDetails/Page_ApplyTUWA/button_Save_AddressDetails'))
WebUI.click(findTestObject('PersonalDetails/Page_ApplyTUWA/button_Save_AddressDetails'))
WebUI.waitForPageLoad(10)

WebUI.waitForElementVisible(findTestObject('PersonalDetails/Page_ApplyTUWA/h3_Personal details Additional questions'))
WebUI.verifyElementVisible(findTestObject('PersonalDetails/Page_ApplyTUWA/h3_Personal details Additional questions'))
WebUI.click(findTestObject('PersonalDetails/Page_ApplyTUWA/h3_Personal details Additional questions))

WebUI.delay(5)   // some wait statement maybe

WebUI.verifyElementVisible(findTestObject('PersonalDetails/Page_ApplyTUWA/select_Select answerSingle Type Cover (cove_4e7451'))
WebUI.selectOptionByIndex(findTestObject('PersonalDetails/Page_ApplyTUWA/select_Select answerSingle Type Cover (cove_4e7451'), 1)
WebUI.verifyOptionSelectedByIndex(findTestObject('PersonalDetails/Page_ApplyTUWA/select_Select answerSingle Type Cover (cove_4e7451'), 1, false, 10)

I noticed that the movie you shared plays for 3 minutes 30 seconds. Your test took such long time to finish. I suppose you got tired of waiting this long duration. I noticed that your test was waiting long seconds (over 30 seconds) repeatedly.

Why did the test run so slow?

I noticed you were using “Self-Healing” ON.

I would recommend you to try turning the “Self-Healing” OFF.

I suppose your test runs and fail far faster.

It’s better to get the result quicker, isn’t it?

How did you do this exactly? Please show the code you tried this.

Why do I ask this?

I suppose the locator you specified was wrong, or you watied at a wrong timing. Your code would tell us how you tried concretely.

How does the locator (XPath) of this TestObject look like?

Does the locator contain a string cove_4e7451 ?

I guess, the part in the HTML which corresponds to the string cove_4e7451 dynamically changes everytime you open the URL on browser. For example, the HTML may have cove_1g2345 or foo_97321 … Please check.

If the part is dynamically changing, then your Test Object locator with a constant string cove_4e7451will never be valid. You need to change the locator so that it is robust against the changing portion.

Your original XPath is fragile.

In the HTML source, in between the string "quesitions" and the "*", how many whitespace characters are there? 1? 2? or more?

If the HTML contains 2 or more whitespace characters (including tabs and newlines) in between questions and *, your XPath would miss the element.

I would recommend you to change it to:

//h3[contains(normalize-space(.), 'Personal details – Additional questions')]

The XPath I suggested above is robust. It intentionally ignores * at the end of the string to match against; It ignores consecutive whitespaces between words.


I guess, you used Katalon’s built-in Web Recording tool, and you expected the tool to have generated good enough locators.

Let me tell you, the locators generated by the tool are not necessarily the best possible ones. They tend to have a lot of points to be improved. Experienced Katalon users won’t hesitate to edit the generated locators manually to improve them.

This error message indicates that you, @di-auto5, used WebUI.selectOptionByIndex keyword.

Are you aware that this keyword assumes that the target HTML uses <select><option>..</option><option>...</option> elements, like this:

However, you haven’t showed us the HTML source of your taget web page.

Does the page really use <select> tag?

Modern javasript frameworks for webapps including React, Angular, Vue … rarely use the <select> tag. These javascript frameworks usually generates <div> elements that visually look like a drop-down list.

I ask you this because the screenshot you shared shows no <select> tag contained:

I have a doubt, you should not use WebUI.selectOptionXXX keyword for your target HTML.

Thank you so much for all the troubleshooting , questions you have asked. I am not sure where to begin. Somehow after posting and repeated trying without much changes it magically appeared to be working!. Only step i would have done is to clear the cache.

I am stuck now at the Personal details - Address details section now. Since the other section is working is it ok if i mentioned about the section with issue now please.

Element is this : Address line 1

The value in there is somehow being retained by the browser cache.. so i want to clear it and try to insert something else.

so i used --code as below
WebUI.clearText(findTestObject(‘PersonalDetails/Page_Apply The University of Western Australia/input_Start typing an address’))

WebUI.setText(findTestObject(‘PersonalDetails/Page_Apply The University of Western Australia/input_Start typing an address’),
’ 11 perth road’)

I have tried to put delay and waifforelement etc.. but no use.

XPATH : //input[@id=‘addressLine1’]

—error generated below…

Test Cases/TC09_Apply_PersonalDetail FAILED.

Reason:

com.kms.katalon.core.exception.StepFailedException: Unable to set text ’ 11 perth road’ of object ‘Object Repository/PersonalDetails/Page_Apply The University of Western Australia/input_Start typing an address’

at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:117)

at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:43)

at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword.setText(SetTextKeyword.groovy:86)

at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword.execute(SetTextKeyword.groovy:39)

at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)

at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.setText(WebUiBuiltInKeywords.groovy:1056)

at TC09_Apply_PersonalDetail.run(TC09_Apply_PersonalDetail:36)

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:448)

at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)

at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)

at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)

at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:133)

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.doCall(CallTestCaseKeyword.groovy:59)

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.call(CallTestCaseKeyword.groovy)

at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:75)

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.callTestCase(CallTestCaseKeyword.groovy:81)

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.execute(CallTestCaseKeyword.groovy:44)

at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)

at com.kms.katalon.core.keyword.BuiltinKeywords.callTestCase(BuiltinKeywords.groovy:310)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at TC00_UAPAPPLY_MASTER.run(TC00_UAPAPPLY_MASTER:86)

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:448)

at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)

at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)

at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)

at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:133)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:124)

at TempTestCase1747034023528.run(TempTestCase1747034023528.groovy:25)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

Caused by: org.openqa.selenium.ElementNotInteractableException: element not interactable

(Session info: chrome=136.0.7103.93)

Build info: version: ‘4.22.0’, revision: ‘c5f3146703’

System info: os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘17.0.7’

Driver info: com.kms.katalon.selenium.driver.CChromeDriver

Command: [28d9644185be44f38e25c99adb4ed08e, clearElement {id=f.525DFB9ECE885F7CABB90D1FF5DFC6EE.d.4BF693F96C45EDAF683F4C070404E69A.e.435}]

Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 136.0.7103.93, chrome: {chromedriverVersion: 135.0.7049.84 (6c019e560019…, userDataDir: C:\Users\00116965\AppData\L…}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:63678}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: windows, proxy: Proxy(), se:cdp: ws://localhost:63678/devtoo…, se:cdpVersion: 136.0.7103.93, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: ignore, webSocketUrl: ws://localhost:44093/sessio…, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}

Element: [[CChromeDriver: chrome on windows (28d9644185be44f38e25c99adb4ed08e)] → xpath: //input[@id=‘addressLine1’] ]

Session ID: 28d9644185be44f38e25c99adb4ed08e

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at org.openqa.selenium.remote.ErrorCodec.decode(ErrorCodec.java:167)

at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:138)

at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:50)

at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:190)

at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:216)

at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:174)

at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:518)

at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:223)

at org.openqa.selenium.remote.RemoteWebElement.clear(RemoteWebElement.java:129)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at org.openqa.selenium.support.decorators.WebDriverDecorator.call(WebDriverDecorator.java:249)

at org.openqa.selenium.support.decorators.DefaultDecorated.call(DefaultDecorated.java:48)

at org.openqa.selenium.support.decorators.WebDriverDecorator.lambda$createProxy$2(WebDriverDecorator.java:321)

at net.bytebuddy.renamed.java.lang.Object$ByteBuddy$MofZYZLL.clear(Unknown Source)

at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword$_setText_closure1.doCall(SetTextKeyword.groovy:55)

at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword$_setText_closure1.call(SetTextKeyword.groovy)

at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:35)


… 37 more

thank you I turned it off.

WebUI.waitForElementClickable(findTestObject(‘PersonalDetails/Page_Apply The University of Western Australia/input_Start typing an address’),
10)

//select[@id=‘ApplicationServiceQuestions[37].MultichoiceServiceQuestionAnswer’]

it is not dynamic. i tried to copy page the xpath to ensure that they are pointing to the right place and they are.

thanks for this tip . i will try to use this

In order to avoid ElementNotInteractableException, after 19 - Select Option By Index, before 20 Set Text,
you should insert waitForElementClickable(findTestObject(input_QuesitonsSponsor

1 Like

Thanks. Its failing way before at step 7.

How about?

WebUI.click(findTestObject('PersonalDetails/Page_Apply The University of Western Australia/h3_Personal details_')

WebUI.waitForPageLoad(10)

// and maybe you might need
WebUI.waitForElementVisible(findTestObject('PersonalDetails/Page_Apply The University of Western Australia/input_Start typing an address'), 10)

WebUI.verifyElementVisible(findTestObject('PersonalDetails/Page_Apply The University of Western Australia/input_Start typing an address'))

WebUI.setText(findTestObject('PersonalDetails/Page_Apply The University of Western Australia/input_Start typing an address'), '11 perth road')

// and just because
WebUI.verifyElementAttributeValue(findTestObject('PersonalDetails/Page_Apply The University of Western Australia/input_Start typing an address'), 'value', '11 perth road', 10)

You are required to make appropriate wait after WebUI.click before WebUI.setText. Always you should do so.

image (1)

The statement #6 calls WebUI.click(something). It will take a while until the web page to respond to the click — it may take some hundreds milliseconds, or a few seconds or more. The response speed depends on many factors, is undeterminable.

On the other hand, your Test Case script run asynchronously to the web page’s response. The script runs fast. After calling WebUI.click(something), the script reach to the next statelement WebUI.setText(somelement, somestring) in just a few milliseconds. The setText will fail because the new view has not yet fully rendered. Such asynchronisity causes errors like ElementNotInteractible.

So, you script should make wait after WebUI.click() before WebUI.setText using WebUI.waitForElementClickable(something,10) or some other way. Otherwise, your script is quite likely fail.

No Luck. THis is again failing

Unable to set text ‘11 perth road’ of object ‘Object Repository/PersonalDetails/Page_Apply The University of Western Australia/h3_Personal details _’ (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to set text ‘11 perth road’ of object ‘Object Repository/PersonalDetails/Page_Apply The University of Western Australia/h3_Personal details _’

at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:117)

at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:43)

at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword.setText(SetTextKeyword.groovy:86)

at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword.execute(SetTextKeyword.groovy:39)

at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)

at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.setText(WebUiBuiltInKeywords.groovy:1056)

at TC09_Apply_PersonalDetail.run(TC09_Apply_PersonalDetail:56)

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:448)

at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)

at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)

at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)

at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:133)

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.doCall(CallTestCaseKeyword.groovy:59)

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.call(CallTestCaseKeyword.groovy)

at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:75)

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.callTestCase(CallTestCaseKeyword.groovy:81)

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.execute(CallTestCaseKeyword.groovy:44)

at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)

at com.kms.katalon.core.keyword.BuiltinKeywords.callTestCase(BuiltinKeywords.groovy:310)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at TC00_UAPAPPLY_MASTER.run(TC00_UAPAPPLY_MASTER:86)

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:448)

at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)

at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)

at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)

at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:133)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:124)

at TempTestCase1747211815340.run(TempTestCase1747211815340.groovy:25)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

Caused by: org.openqa.selenium.InvalidElementStateException: invalid element state

(Session info: chrome=136.0.7103.93)

Build info: version: ‘4.22.0’, revision: ‘c5f3146703’

System info: os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘17.0.7’

Driver info: com.kms.katalon.selenium.driver.CChromeDriver

Command: [3e0979072888acd5b9b1b1420c4905ad, clearElement {id=f.F78A2FDA55097CA452710FC963DB3A94.d.F979DB05B13ACFEDB1EE0CF82CEE6BFB.e.474}]

Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 136.0.7103.93, chrome: {chromedriverVersion: 135.0.7049.84 (6c019e560019…, userDataDir: C:\Users\00116965\AppData\L…}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:59512}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: windows, proxy: Proxy(), se:cdp: ws://localhost:59512/devtoo…, se:cdpVersion: 136.0.7103.93, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: ignore, webSocketUrl: ws://localhost:8871/session…, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}

Element: [[CChromeDriver: chrome on windows (3e0979072888acd5b9b1b1420c4905ad)] → xpath: //h3[(text() = ‘Personal details *’ or . = ‘Personal details *’)]]

Session ID: 3e0979072888acd5b9b1b1420c4905ad

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at org.openqa.selenium.remote.ErrorCodec.decode(ErrorCodec.java:167)

at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:138)

at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:50)

at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:190)

at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:216)

at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:174)

at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:518)

at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:223)

at org.openqa.selenium.remote.RemoteWebElement.clear(RemoteWebElement.java:129)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at org.openqa.selenium.support.decorators.WebDriverDecorator.call(WebDriverDecorator.java:249)

at org.openqa.selenium.support.decorators.DefaultDecorated.call(DefaultDecorated.java:48)

at org.openqa.selenium.support.decorators.WebDriverDecorator.lambda$createProxy$2(WebDriverDecorator.java:321)

at net.bytebuddy.renamed.java.lang.Object$ByteBuddy$wsdfcrZB.clear(Unknown Source)

at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword$_setText_closure1.doCall(SetTextKeyword.groovy:55)

at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword$_setText_closure1.call(SetTextKeyword.groovy)

at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:35)

at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword.setText(SetTextKeyword.groovy:86)

at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword.execute(SetTextKeyword.groovy:39)

at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)

at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.setText(WebUiBuiltInKeywords.groovy:1056)

at Script1746435982579.run(Script1746435982579.groovy:56)

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:448)

at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)

at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)

at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)

at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:133)

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.doCall(CallTestCaseKeyword.groovy:59)

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.call(CallTestCaseKeyword.groovy)

at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:75)

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.callTestCase(CallTestCaseKeyword.groovy:81)

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.execute(CallTestCaseKeyword.groovy:44)

at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)

at com.kms.katalon.core.keyword.BuiltinKeywords.callTestCase(BuiltinKeywords.groovy:310)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at Script1745985092170.run(Script1745985092170.groovy:86)

… 13 more

)

You previously wrote in the original post:

Now you wrote a new XPath:

This XPath looks odd. It looks worse than the previous one. Are you sure it is valid?