# Verify Element Attribute Value

**URL:** <https://forum.katalon.com/t/verify-element-attribute-value/20231>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [February 28, 2019, 10:21am UTC](https://forum.katalon.com/t/verify-element-attribute-value/20231 "2019-02-28T10:21:58Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![hpulsford](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/hpulsford/32/2985_2.png) [@hpulsford](https://forum.katalon.com/u/hpulsford)\
**Post date:** [February 28, 2019, 10:21am UTC](https://forum.katalon.com/t/verify-element-attribute-value/20231/1 "2019-02-28T10:21:59Z")

</div>

Im trying to verify that the string has been inputted correctly and has saved as expected but when using the VerifyElementText tool it gives me that they are not matched however they are. Am i doing something wrong?

 ![Screenshot%20(282)_LI](https://europe1.discourse-cdn.com/katalon/original/2X/6/62a256bb20b1d51aec7898e9b58b8db1c450680c.jpeg)

> **Error log**
>
> Test Cases/touchpoint examples/Add a new job - HR - 9.1 FAILED.  
> Reason:  
> com.kms.katalon.core.exception.StepFailedException: Verify element text of test object ‘Object Repository/Add a new job/Page\_CIPHR Self Service 9.1.0/input\_Job Number \_Job.JobNumbe’ FAILED. (Root cause: com.kms.katalon.core.exception.StepFailedException: Actual text ‘’ and expected text ‘778267’ of test object ‘Object Repository/Add a new job/Page\_CIPHR Self Service 9.1.0/input\_Job Number \_Job.JobNumbe’ are NOT matched.)  
> at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:36)  
> at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:65)  
> at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:27)  
> at com.kms.katalon.core.webui.keyword.builtin.VerifyElementTextKeyword.verifyElementText(VerifyElementTextKeyword.groovy:72)  
> at com.kms.katalon.core.webui.keyword.builtin.VerifyElementTextKeyword.execute(VerifyElementTextKeyword.groovy:40)  
> at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)  
> at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.verifyElementText(WebUiBuiltInKeywords.groovy:3647)  
> at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$verifyElementText$8.call(Unknown Source)  
> at Add a new job - HR - 9.1.run(Add a new job - HR - 9.1:64)  
> 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:328)  
> at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:319)  
> at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:298)  
> at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:290)  
> at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:224)  
> at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:106)  
> at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:97)  
> at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)  
> at TempTestCase1551348940787.run(TempTestCase1551348940787.groovy:22)

> **Script**
>
> ```
> if (WebUI.verifyElementNotVisible(findTestObject('Object Repository/Add a new job/Page_CIPHR Self Service 9.1.0/span_HR Admin'))) {
> WebUI.click(findTestObject('Object Repository/Add a new job/Page_CIPHR Self Service 9.1.0/span_Log Out_glyphicons glyphi'))
> 
> WebUI.click(findTestObject('Object Repository/Add a new job/Page_CIPHR Self Service 9.1.0/span_HR Admin'))
> } else {
> WebUI.click(findTestObject('V9.1 Testing/Page_CIPHR Self Service 9.1.0/span_HR Admin'))
> }
> 
> WebUI.click(findTestObject('Object Repository/Add a new job/Page_CIPHR Self Service 9.1.0/div_Jobs'))
> 
> WebUI.click(findTestObject('Object Repository/Add a new job/Page_CIPHR Self Service 9.1.0/a_Insert New Record'))
> 
> WebUI.setText(findTestObject('Object Repository/Add a new job/Page_CIPHR Self Service 9.1.0/input_Job Number _Job.JobNumbe'), 
> '778267')
> 
> WebUI.setText(findTestObject('Object Repository/Add a new job/Page_CIPHR Self Service 9.1.0/input_Job Title _Job.JobTitle'), 
> 'AA Boss')
> 
> WebUI.click(findTestObject('Object Repository/Add a new job/Page_CIPHR Self Service 9.1.0/span_Department_k-input'))
> 
> WebUI.waitForElementVisible(findTestObject('Add a new job/Page_CIPHR Self Service 9.1.0/li_Chief Executive Office'), 0)
> 
> WebUI.click(findTestObject('Object Repository/Add a new job/Page_CIPHR Self Service 9.1.0/li_Chief Executive Office'))
> 
> WebUI.setText(findTestObject('Object Repository/Add a new job/Page_CIPHR Self Service 9.1.0/input_Date Created_Job.JobCrea'), 
> '12/Feb/2019')
> 
> WebUI.click(findTestObject('Object Repository/Add a new job/Page_CIPHR Self Service 9.1.0/button_Update'))
> 
> WebUI.delay(5)
> 
> WebUI.setText(findTestObject('Object Repository/Add a new job/Page_CIPHR Self Service 9.1.0/textarea_Specification_Job.Job'), 
> 'test')
> 
> WebUI.click(findTestObject('Object Repository/Add a new job/Page_CIPHR Self Service 9.1.0/button_Update'))
> 
> WebUI.delay(4)
> 
> WebUI.waitForElementVisible(findTestObject('Add a new job/Verify job created correctly/td_AA Boss'), 0)
> 
> WebUI.click(findTestObject('Add a new job/Verify job created correctly/td_AA Boss'))
> 
> WebUI.verifyElementPresent(findTestObject('Add a new job/Verify job created correctly/span_Chief Executive Office'), 0)
> 
> WebUI.verifyElementText(findTestObject('Add a new job/Page_CIPHR Self Service 9.1.0/input_Job Number _Job.JobNumbe'), '778267', 
> FailureHandling.STOP_ON_FAILURE)
> 
> WebUI.verifyElementText(findTestObject('Add a new job/Page_CIPHR Self Service 9.1.0/input_Date Created_Job.JobCrea'), '12/Feb/2019')
> 
> ```

---

<div class="post-metadata">

**Author:** ![rvdurga](https://avatars.discourse-cdn.com/v4/letter/r/df788c/32.png) [@rvdurga](https://forum.katalon.com/u/rvdurga)\
**Post date:** [February 28, 2019, 10:32am UTC](https://forum.katalon.com/t/verify-element-attribute-value/20231/2 "2019-02-28T10:32:10Z")

</div>

You might want to use

> WebUI.verifyElementAttributeValue(‘testobject’, ‘value’, ‘expected value’, ‘time for timeout’)

---

<div class="post-metadata">

**Author:** ![hpulsford](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/hpulsford/32/2985_2.png) [@hpulsford](https://forum.katalon.com/u/hpulsford)\
**Post date:** [February 28, 2019, 11:01am UTC](https://forum.katalon.com/t/verify-element-attribute-value/20231/3 "2019-02-28T11:01:37Z")

</div>

After playing about with the attributes this works for me - Thanks 🙂

---

<div class="post-metadata">

**Author:** ![hpulsford](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/hpulsford/32/2985_2.png) [@hpulsford](https://forum.katalon.com/u/hpulsford)\
**Post date:** [February 28, 2019, 11:30am UTC](https://forum.katalon.com/t/verify-element-attribute-value/20231/4 "2019-02-28T11:30:09Z")

</div>

Actaully i have just tried to cross check to verify if the text isnt as expected it should produce an error however it passes even though the value isnt correct. Please see -

 ![Screenshot%20(283)](https://europe1.discourse-cdn.com/katalon/original/2X/5/55adfd724fd6140c2c04562768d52a6ba68bb74a.png)

> **script**
>
> ```
> WebUI.callTestCase(findTestCase('touchpoint examples/Login to CIPHR as HR - 9.1'), [:], FailureHandling.STOP_ON_FAILURE)
> 
> WebUI.maximizeWindow()
> 
> if (WebUI.verifyElementNotVisible(findTestObject('Object Repository/Create a course/trying something else/Page_CIPHR Self Service 9.1.0/span_HR Admin'))) {
> WebUI.click(findTestObject('Object Repository/Create a course/trying something else/Page_CIPHR Self Service 9.1.0/span_Log Out_glyphicons glyphi'))
> 
> WebUI.click(findTestObject('Object Repository/Create a course/trying something else/Page_CIPHR Self Service 9.1.0/span_HR Admin'))
> } else {
> WebUI.click(findTestObject('V9.1 Testing/Page_CIPHR Self Service 9.1.0/span_HR Admin'))
> }
> 
> WebUI.mouseOver(findTestObject('Object Repository/Create a course/trying something else/Page_CIPHR Self Service 9.1.0/div_Training Admin'))
> 
> WebUI.click(findTestObject('Object Repository/Create a course/trying something else/Page_CIPHR Self Service 9.1.0/div_Course Bank'))
> 
> WebUI.click(findTestObject('Object Repository/Create a course/trying something else/Page_CIPHR Self Service 9.1.0/a_Insert New Record'))
> 
> WebUI.setText(findTestObject('Object Repository/Create a course/trying something else/Page_CIPHR Self Service 9.1.0/input_Code _Code'), 
> 'aa booming')
> 
> WebUI.setText(findTestObject('Object Repository/Create a course/trying something else/Page_CIPHR Self Service 9.1.0/input_Title _Title'), 
> 'aa testing 123')
> 
> WebUI.click(findTestObject('Object Repository/Create a course/trying something else/Page_CIPHR Self Service 9.1.0/span_Days_k-link k-link-increa'))
> 
> WebUI.click(findTestObject('Object Repository/Create a course/trying something else/Page_CIPHR Self Service 9.1.0/span_Minimum Places_k-link k-l'))
> 
> WebUI.click(findTestObject('Object Repository/Create a course/trying something else/Page_CIPHR Self Service 9.1.0/span_Optimum Places_k-link k-l'))
> 
> WebUI.click(findTestObject('Object Repository/Create a course/trying something else/Page_CIPHR Self Service 9.1.0/span_Maximum Places_k-link k-l'))
> 
> WebUI.click(findTestObject('Object Repository/Create a course/trying something else/Page_CIPHR Self Service 9.1.0/span_Training CPD_k-link k-lin'))
> 
> WebUI.click(findTestObject('Object Repository/Create a course/trying something else/Page_CIPHR Self Service 9.1.0/span_Hours_k-link k-link-incre'))
> 
> WebUI.setText(findTestObject('Object Repository/Create a course/trying something else/Page_CIPHR Self Service 9.1.0/input_Administrator_Administra'), 
> 'test')
> 
> WebUI.setText(findTestObject('Object Repository/Create a course/trying something else/Page_CIPHR Self Service 9.1.0/input_Administrator Job Title_'), 
> 'boss')
> 
> WebUI.click(findTestObject('Object Repository/Create a course/trying something else/Page_CIPHR Self Service 9.1.0/button_Update'))
> 
> WebUI.waitForElementVisible(findTestObject('Create a course/verify course created/td_aa testing 123'), 0)
> 
> WebUI.click(findTestObject('Create a course/verify course created/td_aa testing 123'))
> 
> WebUI.verifyElementAttributeValue(findTestObject('Create a course/verify course created/input_Days_k-formatted-value k'), 
> 'aria-valuenow', '6', 0)
> 
> WebUI.verifyElementAttributeValue(findTestObject('Create a course/verify course created/input_Code _Code'), 'value', 'aa booming', 
> 0)
> 
> WebUI.verifyElementAttributeValue(findTestObject('Create a course/verify course created/input_Administrator_Administra'), 
> 'value', 'test', 0)
> 
> WebUI.verifyElementAttributeValue(findTestObject('Create a course/verify course created/input_Administrator Job Title_'), 
> 'value', 'boss', 0)
> 
> ```

Please note - that when i run the script it flys through all the other very elements but when it gets to these that are wrong, it does think about it for a second and then carries on

---

<div class="post-metadata">

**Author:** ![rvdurga](https://avatars.discourse-cdn.com/v4/letter/r/df788c/32.png) [@rvdurga](https://forum.katalon.com/u/rvdurga)\
**Post date:** [February 28, 2019, 11:45am UTC](https://forum.katalon.com/t/verify-element-attribute-value/20231/5 "2019-02-28T11:45:28Z")

</div>

Tried adding failurehandling?

In your case it would be something like this.

```
WebUI.verifyElementAttributeValue(findTestObject('Create a course/verify course created/input_Administrator_Administra'), 'value', 'test', 0, FailureHandling.STOP_ON_FAILURE)
```

---

<div class="post-metadata">

**Author:** ![hpulsford](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/hpulsford/32/2985_2.png) [@hpulsford](https://forum.katalon.com/u/hpulsford)\
**Post date:** [February 28, 2019, 11:56am UTC](https://forum.katalon.com/t/verify-element-attribute-value/20231/6 "2019-02-28T11:56:13Z")

</div>

its strange i got it to work once, but now trying it again it just passes 🤨

---

<div class="post-metadata">

**Author:** ![rvdurga](https://avatars.discourse-cdn.com/v4/letter/r/df788c/32.png) [@rvdurga](https://forum.katalon.com/u/rvdurga)\
**Post date:** [February 28, 2019, 11:58am UTC](https://forum.katalon.com/t/verify-element-attribute-value/20231/7 "2019-02-28T11:58:54Z")

</div>

Perhaps a bug in katalon itself

---

<div class="post-metadata">

**Author:** ![hpulsford](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/hpulsford/32/2985_2.png) [@hpulsford](https://forum.katalon.com/u/hpulsford)\
**Post date:** [February 28, 2019, 11:59am UTC](https://forum.katalon.com/t/verify-element-attribute-value/20231/8 "2019-02-28T11:59:53Z")

</div>

yea maybe @devalex88, is there anything you can advise?

So ive done some playing about with it, if i run my script, then after its verified them that are correct, then change the strings to something not correct and “run from here” just for the last 4 steps it picks up that they are not equal and gives me this error which i would expect -

```
Test Cases/touchpoint examples/Create course - HR - 9.1 FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to verify if object 'Object Repository/Create a course/verify course created/input_Administrator_Administra' has attribute 'value' with value 'test' (Root cause: com.kms.katalon.core.exception.StepFailedException: Object 'Object Repository/Create a course/verify course created/input_Administrator_Administra' has attribute 'value' with actual value 'fsfgdsg' instead of expected value 'test')
	at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:36)
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:65)
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:27)
	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:56)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.verifyElementAttributeValue(WebUiBuiltInKeywords.groovy:3234)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$verifyElementAttributeValue.call(Unknown Source)
at Create course - HR - 9.1.run(Create course - HR - 9.1:70)
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:298)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:290)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:224)
at com.kms.katalon.core.main.TestCaseMain.runTestCaseRawScript(TestCaseMain.java:143)
at com.kms.katalon.core.main.TestCaseMain$runTestCaseRawScript$0.call(Unknown Source)
at TempTestCase1551355290706.run(TempTestCase1551355290706.groovy:98) 

```

It seems to be working fine but did have some inconsistent runs

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [February 28, 2019, 1:15pm UTC](https://forum.katalon.com/t/verify-element-attribute-value/20231/9 "2019-02-28T13:15:31Z")

</div>

Hey @hpulsford

This is what is commonly referred to as a “flaky test”. You should endeavor to find the cause if the flakiness because it **will** bite you later.

In this kind of situation, it’s good to remember the saying (often attributed to Mark Twain, and here modified a little for modern parlance) …

> “It isn’t what you _don’t know_ that is the problem, it’s the thing you _think you know_ that is actually wrong.” [It Ain’t What You Don’t Know That Gets You Into Trouble. It’s What You Know for Sure That Just Ain’t So – Quote Investigator®](https://quoteinvestigator.com/2018/11/18/know-trouble/)

In other words, be sure you’re not building “truth” from a starting point of falsehood. It’s just too damn easy to do and we ALL do it. With a flaky test, start over, question everything you think you know.

---

<div class="post-metadata">

**Author:** ![hpulsford](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/hpulsford/32/2985_2.png) [@hpulsford](https://forum.katalon.com/u/hpulsford)\
**Post date:** [February 28, 2019, 1:20pm UTC](https://forum.katalon.com/t/verify-element-attribute-value/20231/10 "2019-02-28T13:20:12Z")

</div>

Hey @Russ_Thomas

Haha you are so right with that quote, i think im kididng myself that its resolved, ive taken the solution mark away. Im going to do some more digging trying different scenaios to see if i can replicate again and then have a deeper look as to what might be causing it.

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [February 28, 2019, 1:29pm UTC](https://forum.katalon.com/t/verify-element-attribute-value/20231/11 "2019-02-28T13:29:15Z")

</div>

> [@hpulsford](#):
>
> i think im kididng myself that its resolved

🙂

You almost nailed another well-known quote, this time from Richard Feynman:

> “The first principle is that you must not fool yourself - and you are the easiest person to fool.”

---

<div class="post-metadata">

**Author:** ![hpulsford](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/hpulsford/32/2985_2.png) [@hpulsford](https://forum.katalon.com/u/hpulsford)\
**Post date:** [February 28, 2019, 1:30pm UTC](https://forum.katalon.com/t/verify-element-attribute-value/20231/12 "2019-02-28T13:30:45Z")

</div>

Ok so its definately not fixed - I have changed a few elements to try a different scenario and it is passing. I have changed the attribute value to something different to what has been inputted in previous steps, so from my understanding because it doesnt equal ‘hfhar’ instead the field is populated with ‘test’ it should through me an error?

Ultimately im attempting to verify the input into a element is correct - if anyone knows a way to do this any help will be appreciated 😃

 ![Screenshot%20(285)](https://europe1.discourse-cdn.com/katalon/original/2X/c/ca3001a9634ffeb099d5bc4d313ec6b9b45bb4fe.png)

 ![Screenshot%20(284)_LI](https://europe1.discourse-cdn.com/katalon/original/2X/5/5003341ebb9156e46d19b0b9b50006f019a70382.jpeg)

```
WebUI.verifyElementAttributeValue(findTestObject('Create a course/verify course created/input_Days_k-formatted-value k'), 
    'aria-valuenow', '6', 0, FailureHandling.STOP_ON_FAILURE)

WebUI.verifyElementAttributeValue(findTestObject('Create a course/verify course created/input_Code _Code'), 'value', 'aa booming', 
    0, FailureHandling.STOP_ON_FAILURE)

WebUI.verifyElementAttributeValue(findTestObject('Create a course/verify course created/input_Administrator_Administra'), 
    'value', 'hfhar', 0, FailureHandling.STOP_ON_FAILURE)

WebUI.verifyElementAttributeValue(findTestObject('Create a course/verify course created/input_Administrator Job Title_'), 
    'value', 'boss', 0, FailureHandling.STOP_ON_FAILURE)

```

---

<div class="post-metadata">

**Author:** ![hpulsford](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/hpulsford/32/2985_2.png) [@hpulsford](https://forum.katalon.com/u/hpulsford)\
**Post date:** [February 28, 2019, 1:40pm UTC](https://forum.katalon.com/t/verify-element-attribute-value/20231/13 "2019-02-28T13:40:29Z")

</div>

@Russ_Thomas

King of quotes 👑

---

<div class="post-metadata">

**Author:** ![rvdurga](https://avatars.discourse-cdn.com/v4/letter/r/df788c/32.png) [@rvdurga](https://forum.katalon.com/u/rvdurga)\
**Post date:** [February 28, 2019, 2:28pm UTC](https://forum.katalon.com/t/verify-element-attribute-value/20231/14 "2019-02-28T14:28:18Z")

</div>

Perhaps a silly question, but with the update button you save your changes before you verify the new text right?

---

<div class="post-metadata">

**Author:** ![hpulsford](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/hpulsford/32/2985_2.png) [@hpulsford](https://forum.katalon.com/u/hpulsford)\
**Post date:** [February 28, 2019, 2:30pm UTC](https://forum.katalon.com/t/verify-element-attribute-value/20231/15 "2019-02-28T14:30:56Z")

</div>

Yes i update the record, get brought back to the summary page \> go back into the record \> then want to verify that the strings are correct

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [February 28, 2019, 2:50pm UTC](https://forum.katalon.com/t/verify-element-attribute-value/20231/16 "2019-02-28T14:50:46Z")

</div>

This is the failing line, correct?

> [@hpulsford](#):
>
> ```auto
> WebUI.verifyElementAttributeValue(findTestObject('Create a course/verify course created/input_Administrator_Administra'), 
> 'value', 'hfhar', 0, FailureHandling.STOP_ON_FAILURE)
> 
> ```

Let’s do this so we can see a bit better and try waiting a little:

```auto
String vcc = "Create a course/verify course created/"
def to

// assuming your default failure handling is set to STOP_ON_FAILURE:

to = findTestObject(vcc + 'input_Days_k-formatted-value k')
WebUI.verifyElementAttributeValue(to, 'aria-valuenow', '6', 20)

to = findTestObject(vcc + 'input_Code _Code')
WebUI.verifyElementAttributeValue(to, 'value', 'aa booming', 20)

to = findTestObject(vcc + 'input_Administrator_Administra')
WebUI.verifyElementAttributeValue(to, 'value', 'hfhar', 20)

to = findTestObject(vcc + 'input_Administrator Job Title_')
WebUI.verifyElementAttributeValue(to, 'value', 'boss', 20)

```

See how that performs.

---

<div class="post-metadata">

**Author:** ![hpulsford](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/hpulsford/32/2985_2.png) [@hpulsford](https://forum.katalon.com/u/hpulsford)\
**Post date:** [February 28, 2019, 3:05pm UTC](https://forum.katalon.com/t/verify-element-attribute-value/20231/17 "2019-02-28T15:05:03Z")

</div>

> [@Russ\_Thomas](#):
>
> to = findTestObject(vcc + ‘input\_Administrator\_Administra’) WebUI.verifyElementAttributeValue(to, ‘value’, ‘hfhar’, 20)

Thanks for the help mate, so it stopped on this step for the 20 secs then carried on, yes my default is set to STOP\_ON-FAILURE so surely it should have thrown an error?

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [February 28, 2019, 3:26pm UTC](https://forum.katalon.com/t/verify-element-attribute-value/20231/18 "2019-02-28T15:26:39Z")

</div>

And the value looked to be correct when you viewed the page? If yes, then there’s something screwy going on.

Let’s be clear: what is the error? (Your previous error message indicates it expects “test” but has “fsfgdsg”)

Please don’t make me chase unicorns. (I’m old, they run too fast)

---

<div class="post-metadata">

**Author:** ![hpulsford](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/hpulsford/32/2985_2.png) [@hpulsford](https://forum.katalon.com/u/hpulsford)\
**Post date:** [February 28, 2019, 3:30pm UTC](https://forum.katalon.com/t/verify-element-attribute-value/20231/19 "2019-02-28T15:30:27Z")

</div>

hahah - So the value thats in the element (administrator) is test (so its wrong) so im expecting an error telling me that it expects “hfhar” but has “test”. All im doing is verifing after to check that the correct string was inputted as on some pages we have had this bug in the past.

Hope that make sense, sorry if i confused you earlier

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [February 28, 2019, 3:43pm UTC](https://forum.katalon.com/t/verify-element-attribute-value/20231/20 "2019-02-28T15:43:47Z")

</div>

There’s nothing wrong with what you’e trying to do (assuming I’m understanding you correctly). However, start from a _known state_. This goes back to the earlier conversation. I don’t think you have a known state.

Steps:

1. Make the test work for reasons _you can prove_.
2. Now check your reasoning: _Break it_. Break it in such a way that it _challenges your reasoning_.

Did it break exactly how you expected? No? Then you failed at #1 - **NOT #2**

If you _can_ break it in ways you can predict, then you have a known state. From there, you repeat the steps above in multiple different ways (each little test then “shores up” your reasoning and makes you feel good about the test as whole).

Or you can do what the pretenders do. Wing it and hope for the best. Your call.

I should add: If Katalon is broken in the way you’re suggesting, where’s the evidence? Where are the many hundreds of reports we would surely see if that were the case?

So I’m saying, take a long hard look at steps 1 and 2. The time is worth it.

(Aside: I’ve changed the title of this thread to better reflect what’s going on)

[Next page](https://forum.katalon.com/t/verify-element-attribute-value/20231.md?page=2)
