Verify disabled Input Element

Hi,

I am stumbled upon the issue where I can not verify a disabled class with a value which I get from Excel.
In my mind I’ve tried loads of things in hope to fix this, but alas I was not able to. So I turn to the community.

I’ve tried to store the value of the disabled class and then verify it with the value from Excel.
I have tried to just verify the text on the page.
I have tried to create a match and verify this.

However I am not able to verify the value inside the disabled class.
Anyone here knows how I am able to fix my problem?

Kind regards,
Paulo

You can’t expect us to help with such limited information.

Post the code that fails.
Post the errors (if any).
Post the HTML you’re trying to verify.
Follow this advice:

Hi Russ,

Thanks for the reply and here is the information you asked for.
I will start from the start.

This is the HTML code. My aim is to verify the value inside this code.

This is the part of the script in Katalon.

This is the error I am getting.

11-05-2019 10:40:52 AM verifyTextPresent(findTestData(“Data_Template (RIV20-69)”).getValue(22, rowNum), false)

Elapsed time: 2,748s

Text ‘68,00’ is not present on page (Root cause: com.kms.katalon.core.exception.StepFailedException: Text ‘68,00’ is not present on page
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.builtin.VerifyTextPresentKeyword$_verifyTextPresent_closure1.doCall(VerifyTextPresentKeyword.groovy:79)
at com.kms.katalon.core.webui.keyword.builtin.VerifyTextPresentKeyword$_verifyTextPresent_closure1.call(VerifyTextPresentKeyword.groovy)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
at com.kms.katalon.core.webui.keyword.builtin.VerifyTextPresentKeyword.verifyTextPresent(VerifyTextPresentKeyword.groovy:83)
at com.kms.katalon.core.webui.keyword.builtin.VerifyTextPresentKeyword.execute(VerifyTextPresentKeyword.groovy:68)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:60)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.verifyTextPresent(WebUiBuiltInKeywords.groovy:1693)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$verifyTextPresent.call(Unknown Source)
at Insert premium values (RIV20-154).run(Insert premium values (RIV20-154):69)
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.RawTestScriptExecutor.runScript(RawTestScriptExecutor.java:34)
at com.kms.katalon.core.main.RawTestScriptExecutor.doExecute(RawTestScriptExecutor.java:29)
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.runTestCaseRawScript(TestCaseMain.java:151)
at com.kms.katalon.core.main.TestCaseMain$runTestCaseRawScript$0.call(Unknown Source)
at TempTestCase1572946849228.run(TempTestCase1572946849228.groovy:95)
)

Hey @paulo.resende,

I stumbled uppon a similar problem today but with if - else…
I had to add Failure Handling for verifying. It looks like this:

WebUI.verifyOptionPresentByLabel(findTestObject(‘Page_Erffnung Exklusiv Konto/select_Fililale’), GlobalVariable.FilialeSparda, true, 20, FailureHandling.OPTIONAL)

Dont forget to Organize your Imports after adding the Failure Handling (CTRL+SHIFT+O)

I hope it works for you too

It sounds like you’re trying to read the value from an HTML <input> element (it happens to be disabled too, which has nothing to do with its class, btw). You will not be able to verify the content of an input element using verifyTextPresent which is for reading “free text” on the page.

You need…

verifyElementAttributeValue(
  findTestObject("path/to/test_object"), // your TestObject from OR
  "value", // the element attribute you want to verify
  findTestData(“Data_Template (RIV20-69)”).getValue(22, rowNum), // the value
  20, // timeout (how long to wait)
)

Thanks for the reply and example.
I’ve tried this fix but still get an error.
This is my script how I wrote it now.

This is my object.

This is the error

11-05-2019 04:07:32 PM Test Cases/Sprint 6/Insert premium values (RIV20-154)

Elapsed time: 2,390s

Test Cases/Sprint 6/Insert premium values (RIV20-154) FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Object ‘Object Repository/Page_Verzekeringen/proposalCalculatedPremium’ does not have attribute ‘CalculatedPremium’ (Root cause: com.kms.katalon.core.exception.StepFailedException: Object ‘Object Repository/Page_Verzekeringen/proposalCalculatedPremium’ does not have attribute ‘CalculatedPremium’
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.builtin.VerifyElementAttributeValueKeyword$_verifyElementAttributeValue_closure1.doCall(VerifyElementAttributeValueKeyword.groovy:98)
at com.kms.katalon.core.webui.keyword.builtin.VerifyElementAttributeValueKeyword$_verifyElementAttributeValue_closure1.call(VerifyElementAttributeValueKeyword.groovy)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
at com.kms.katalon.core.webui.keyword.builtin.VerifyElementAttributeValueKeyword.verifyElementAttributeValue(VerifyElementAttributeValueKeyword.groovy:109)
at com.kms.katalon.core.webui.keyword.builtin.VerifyElementAttributeValueKeyword.execute(VerifyElementAttributeValueKeyword.groovy:70)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:60)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.verifyElementAttributeValue(WebUiBuiltInKeywords.groovy:3252)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$verifyElementAttributeValue.call(Unknown Source)
at Insert premium values (RIV20-154).run(Insert premium values (RIV20-154):77)
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.RawTestScriptExecutor.runScript(RawTestScriptExecutor.java:34)
at com.kms.katalon.core.main.RawTestScriptExecutor.doExecute(RawTestScriptExecutor.java:29)
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.runTestCaseRawScript(TestCaseMain.java:151)
at com.kms.katalon.core.main.TestCaseMain$runTestCaseRawScript$0.call(Unknown Source)
at TempTestCase1572966450583.run(TempTestCase1572966450583.groovy:103)
)
at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:39)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.builtin.VerifyElementAttributeValueKeyword$_verifyElementAttributeValue_closure1.doCall(VerifyElementAttributeValueKeyword.groovy:98)
at com.kms.katalon.core.webui.keyword.builtin.VerifyElementAttributeValueKeyword$_verifyElementAttributeValue_closure1.call(VerifyElementAttributeValueKeyword.groovy)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
at com.kms.katalon.core.webui.keyword.builtin.VerifyElementAttributeValueKeyword.verifyElementAttributeValue(VerifyElementAttributeValueKeyword.groovy:109)
at com.kms.katalon.core.webui.keyword.builtin.VerifyElementAttributeValueKeyword.execute(VerifyElementAttributeValueKeyword.groovy:70)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:60)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.verifyElementAttributeValue(WebUiBuiltInKeywords.groovy:3252)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$verifyElementAttributeValue.call(Unknown Source)
at Insert premium values (RIV20-154).run(Insert premium values (RIV20-154):77)
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.RawTestScriptExecutor.runScript(RawTestScriptExecutor.java:34)
at com.kms.katalon.core.main.RawTestScriptExecutor.doExecute(RawTestScriptExecutor.java:29)
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.runTestCaseRawScript(TestCaseMain.java:151)
at com.kms.katalon.core.main.TestCaseMain$runTestCaseRawScript$0.call(Unknown Source)
at TempTestCase1572966450583.run(TempTestCase1572966450583.groovy:103)
Caused by: com.kms.katalon.core.exception.StepFailedException: Object ‘Object Repository/Page_Verzekeringen/proposalCalculatedPremium’ does not have attribute ‘CalculatedPremium’
… 20 more

For some reason it gives an eror on my object when I use the same ID name.

Thanks for the reply.
I tried this trick but it didn’t work. While the testcase succeeds. I get the message that it was not able to verify.

You changed the code, why?

You need the value attribute.

Ah, I thought I was ment to change that as well.
I’m not that great at coding yet, still learning.

It worked!
Thanks a lot!

1 Like

Keep going. READ MORE.

All great authors programmers read more books code than they write.

1 Like