# Element is not visible until a data set is correct

**URL:** <https://forum.katalon.com/t/element-is-not-visible-until-a-data-set-is-correct/21471>\
**Category:** Web Testing\
**Tags:** web-testing, katalon-studio\
**Created:** [March 19, 2019, 4:20pm UTC](https://forum.katalon.com/t/element-is-not-visible-until-a-data-set-is-correct/21471 "2019-03-19T16:20:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mathiasduarte99](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/mathiasduarte99/32/16104_2.png) [@mathiasduarte99](https://forum.katalon.com/u/mathiasduarte99)\
**Post date:** [March 19, 2019, 4:20pm UTC](https://forum.katalon.com/t/element-is-not-visible-until-a-data-set-is-correct/21471/1 "2019-03-19T16:20:26Z")

</div>

Need help, I have an object that does not appear in html until a data set is correct, the issue is that when I test with verifyElementNotPresent it gives me an error saying Unable to verify object ‘Object Repository / EntryChasisYmotorEmpadronamiento / Valor\_Patente’ is not present.  
Also, that when the element is already present in the html that leaves the iteration and enter value in the field that was not visible before.  
attached code:

```auto
    boolean var= WebUI.verifyElementNotPresent(findTestObject('Object Repository/IngresoChasisYmotorEmpadronamiento/Valor_Patente'),10)
    if (var == true) {
    	for (def row = 1; row <= findTestData('ChasisYMotor').getRowNumbers(); row++) {
    		WebUI.setText(findTestObject('IngresoChasisYmotorEmpadronamiento/Nro.Chasis'), findTestData('ChasisYMotor').getValue(
    				'CHASIS', row))
    	
    		WebUI.setText(findTestObject('IngresoChasisYmotorEmpadronamiento/Nro.Motor'), findTestData('ChasisYMotor').getValue(
    				'MOTOR', row))
    	
    	WebUI.click(findTestObject('IngresoChasisYmotorEmpadronamiento/BotonBuscar'))
    	}
    	}
    else (var==false) {
    			WebUI.setText(findTestObject('Object Repository/IngresoChasisYmotorEmpadronamiento/Valor_Patente'),
    		'20000')
    	}

```

---

<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:** [March 19, 2019, 4:31pm UTC](https://forum.katalon.com/t/element-is-not-visible-until-a-data-set-is-correct/21471/2 "2019-03-19T16:31:21Z")

</div>

> [@mathiasduarte99](#):
>
> Need help,Tengo un objeto que no aparece en html hasta que un juego de datos es el correcto, el tema es que cuando pruebo con verifyElementNotPresent me da un error diciendo Unable to verify object ‘Object Repository/IngresoChasisYmotorEmpadronamiento/Valor\_Patente’ is not present.  
> Ademas, que cuando el elemento ya este presente en el html que salga de la iteracion y ingrese valor en el campo que no estaba visible anteriormente.  
> Adjunto codigo:

Please try to post in English. Google translation:

> Need help, I have an object that does not appear in html until a data set is correct, the issue is that when I test with verifyElementNotPresent it gives me an error saying Unable to verify object ‘Object Repository / EntryChasisYmotorEmpadronamiento / Valor\_Patente’ is not present.  
> Also, that when the element is already present in the html that leaves the iteration and enter value in the field that was not visible before.

---

<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:** [March 19, 2019, 4:38pm UTC](https://forum.katalon.com/t/element-is-not-visible-until-a-data-set-is-correct/21471/3 "2019-03-19T16:38:01Z")

</div>

There is a problem with your code.

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/7/7f4958415ceab233e03058602fdb471d3a57c027.png)

Try this construct:

```auto
boolean var= WebUI.verifyElementNotPresent(findTestObject('Object Repository/IngresoChasisYmotorEmpadronamiento/Valor_Patente'),10)
    if (var == true) {
     // same stuff
    } else {
      WebUI.setText(findTestObject('Object Rep...'))
    }

```

Edit your code to look like that, then let us know what’s happening.

---

<div class="post-metadata">

**Author:** ![mathiasduarte99](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/mathiasduarte99/32/16104_2.png) [@mathiasduarte99](https://forum.katalon.com/u/mathiasduarte99)\
**Post date:** [March 19, 2019, 4:44pm UTC](https://forum.katalon.com/t/element-is-not-visible-until-a-data-set-is-correct/21471/4 "2019-03-19T16:44:29Z")

</div>

Thanks for the correction in the part of the code, but the problem is in Boolean var = WebUI.verifyElementNotPresent (findTestObject (‘Object Repository / EntryChasisYmotorEmpadronamiento / Valor\_Patiente’), 10), since validating that the element is not visible gives me the error in  
-Reason:  
com.kms.katalon.core.exception.StepFailedException: Unable to verify object ‘Object Repository/IngresoChasisYmotorEmpadronamiento/Valor\_Patente’ is not present  
at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:48)

---

<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:** [March 19, 2019, 4:50pm UTC](https://forum.katalon.com/t/element-is-not-visible-until-a-data-set-is-correct/21471/5 "2019-03-19T16:50:31Z")

</div>

> [@mathiasduarte99](#):
>
> Thanks for the correction in the part of the code, but the problem is in Boolean var = WebUI.verifyElementNotPresent (findTestObject (‘Object Repository / EntryChasisYmotorEmpadronamiento / Valor\_Patiente’), 10),

I’m sorry, I don’t believe that’s true.

> [@](#):
>
> since validating that the element is not visible gives me the error…

But you are not validating the element is not VISIBLE, you’re verifying the element is not _PRESENT_.

1. **Present** : true if the element can be found in the DOM.
2. **Visible** : true if the element can be found AND it is visible in the viewport (screen).

Plus, pay attention to the difference between:

1. _verifying_ something is present/visible
2. _waiting until_ something is present/visible

[https://docs.katalon.com/katalon-studio/docs/webui-wait-for-element-present.html](https://docs.katalon.com/katalon-studio/docs/webui-wait-for-element-present.html)  
[https://docs.katalon.com/katalon-studio/docs/webui-wait-for-element-visible.html](https://docs.katalon.com/katalon-studio/docs/webui-wait-for-element-visible.html)

Or, in your case, this maybe:

[https://docs.katalon.com/katalon-studio/docs/webui-wait-for-element-not-present.html](https://docs.katalon.com/katalon-studio/docs/webui-wait-for-element-not-present.html)

---

<div class="post-metadata">

**Author:** ![Timo\_Kuisma](https://avatars.discourse-cdn.com/v4/letter/t/8baadc/32.png) [@Timo\_Kuisma](https://forum.katalon.com/u/Timo_Kuisma)\
**Post date:** [March 19, 2019, 7:03pm UTC](https://forum.katalon.com/t/element-is-not-visible-until-a-data-set-is-correct/21471/6 "2019-03-19T19:03:43Z")

</div>

hi,  
boolean condition

```
if (var) --> executed if var=true
if (!var) --> executed if var=false
```
