I am getting an exception “InvalidElementStateException: invalid element state.
Can someone look?

1 Like

I notice you have a couple of “selectOptionByValue” ahead of your issue. Sometimes when selecting a value, the content and state of various elements on the page can change. Perhaps you need a wait to ensure your page is stable, such as:

WebUI.selectOptionByValue(findTestObject('...'), 'the value', false)
WebUI.verifyOptionSelectedByValue(findTestObject('...'), 'the value', false, 10)

WebUI.selectOptionByValue(findTestObject('...'), 'the value2', false)
WebUI.verifyOptionSelectedByValue(findTestObject('...'), 'the value2', false, 10)

WebUI.waitForElementClickable(findTestObject('textarea element'), 10)
WebUI.setText(findTestObject('textarea element'), 'your text')
WebUI.verifyElementAttributeValue(findTestObject('textarea element'), "value", 'your text', 10)

WebUI.waitForElementClickable(findTestObject('textbox element'), 10)
WebUI.setText(findTestObject('textbox element'), '12.000.000,00')
WebUI.verifyElementAttributeValue(findTestObject('textbox element'), "value", '12.000.000,00', 10)

Edit: you didn’t say which version of KS you are on, however, some on this forum say that waitForElementClickable is not performing as it should. Try it and see if it works on your version.

Edit2: here is another possibility:

1 Like