# Unable to execute the script thru excel with 25 records

**URL:** <https://forum.katalon.com/t/unable-to-execute-the-script-thru-excel-with-25-records/33874>\
**Category:** Web Testing\
**Tags:** web-testing, katalon-studio\
**Created:** [September 27, 2019, 3:23pm UTC](https://forum.katalon.com/t/unable-to-execute-the-script-thru-excel-with-25-records/33874 "2019-09-27T15:23:44Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![usekatalon](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/usekatalon/32/16103_2.png) [@usekatalon](https://forum.katalon.com/u/usekatalon)\
**Post date:** [September 27, 2019, 3:23pm UTC](https://forum.katalon.com/t/unable-to-execute-the-script-thru-excel-with-25-records/33874/1 "2019-09-27T15:23:44Z")

</div>

Running a data driven test and my excel sheet has 25 records to insert…suddenly it is failing after few recors inserted saying that “unable to find the object”.

Any suggestions would be appreciated?

---

<div class="post-metadata">

**Author:** ![ehernandez](https://avatars.discourse-cdn.com/v4/letter/e/7ba0ec/32.png) [@ehernandez](https://forum.katalon.com/u/ehernandez)\
**Post date:** [September 27, 2019, 3:26pm UTC](https://forum.katalon.com/t/unable-to-execute-the-script-thru-excel-with-25-records/33874/2 "2019-09-27T15:26:17Z")

</div>

were gonna need some scripts or error messages in order to help you better. can you run the test and post the log here?

---

<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:** [September 27, 2019, 3:28pm UTC](https://forum.katalon.com/t/unable-to-execute-the-script-thru-excel-with-25-records/33874/3 "2019-09-27T15:28:02Z")

</div>

hello,

how excel is read?

---

<div class="post-metadata">

**Author:** ![usekatalon](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/usekatalon/32/16103_2.png) [@usekatalon](https://forum.katalon.com/u/usekatalon)\
**Post date:** [September 27, 2019, 3:41pm UTC](https://forum.katalon.com/t/unable-to-execute-the-script-thru-excel-with-25-records/33874/4 "2019-09-27T15:41:21Z")

</div>

excel is reading well if not script would have been failed in the starting stage itself. I ran the script now with 25 records and it was running fine till 18th record and got failed on 19th record…below are logs:

2019-09-27 08:35:58.423 INFO c.k.k.c.webui.common.WebUiCommonHelper - Unable to find the element located by ‘By.xpath: //input[@id=‘Last’]’. Please recheck the objects properties to make sure the desired element is located.  
2019-09-27 08:35:59.169 ERROR c.k.k.core.keyword.internal.KeywordMain - ❌ Unable to set text ‘MATHIS1’ of object ‘Object Repository/Reg/input\_Last\_Last’ (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to set text ‘MATHIS1’ of object ‘Object Repository/Reg/input\_Last\_Last’  
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)  
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)  
at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword.setText(SetTextKeyword.groovy:66)  
at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword.execute(SetTextKeyword.groovy:37)  
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)  
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.setText(WebUiBuiltInKeywords.groovy:950)  
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$setText$1.call(Unknown Source)  
at TC\_Reg.run(TC\_Reg:61)  
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:337)  
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)  
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.runTestCase(TestCaseMain.java:114)  
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)  
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)

---

<div class="post-metadata">

**Author:** ![usekatalon](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/usekatalon/32/16103_2.png) [@usekatalon](https://forum.katalon.com/u/usekatalon)\
**Post date:** [September 27, 2019, 3:42pm UTC](https://forum.katalon.com/t/unable-to-execute-the-script-thru-excel-with-25-records/33874/5 "2019-09-27T15:42:58Z")

</div>

hi Hernandez

posted the logs in the below

---

<div class="post-metadata">

**Author:** ![ehernandez](https://avatars.discourse-cdn.com/v4/letter/e/7ba0ec/32.png) [@ehernandez](https://forum.katalon.com/u/ehernandez)\
**Post date:** [September 27, 2019, 3:43pm UTC](https://forum.katalon.com/t/unable-to-execute-the-script-thru-excel-with-25-records/33874/6 "2019-09-27T15:43:23Z")

</div>

What happens after each time you finish a line? does the page refresh? if so the element could be stale and you may need to delay a second in order to allow to load

---

<div class="post-metadata">

**Author:** ![usekatalon](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/usekatalon/32/16103_2.png) [@usekatalon](https://forum.katalon.com/u/usekatalon)\
**Post date:** [September 27, 2019, 3:45pm UTC](https://forum.katalon.com/t/unable-to-execute-the-script-thru-excel-with-25-records/33874/7 "2019-09-27T15:45:09Z")

</div>

yes screen will be refreshed after inserting every record. so you mean to say need to give timeout for all elements.

---

<div class="post-metadata">

**Author:** ![ehernandez](https://avatars.discourse-cdn.com/v4/letter/e/7ba0ec/32.png) [@ehernandez](https://forum.katalon.com/u/ehernandez)\
**Post date:** [September 27, 2019, 3:49pm UTC](https://forum.katalon.com/t/unable-to-execute-the-script-thru-excel-with-25-records/33874/8 "2019-09-27T15:49:28Z")

</div>

thats correct, give it a 1 second timeout. (in some cases, in my testing, I will add unnecessarily long wait times so that I can witness the page doing its magic. IF the test passes with Long wait times, its most likely a loading issue which youll need to work around. I like to do simple functions that

1. Check if an element exists,
2. Check if an element does not exist

using these, you can usually build a very good wait formula. Because using WebUI.delay() isnt always the best method

---

<div class="post-metadata">

**Author:** ![Peter\_Wilson](https://avatars.discourse-cdn.com/v4/letter/p/9fc29f/32.png) [@Peter\_Wilson](https://forum.katalon.com/u/Peter_Wilson)\
**Post date:** [September 27, 2019, 5:07pm UTC](https://forum.katalon.com/t/unable-to-execute-the-script-thru-excel-with-25-records/33874/9 "2019-09-27T17:07:17Z")

</div>

Yes, from this error: `Unable to find the element located by ‘By.xpath: //input[@id=‘Last’]’. Please recheck the objects properties to make sure the desired element is located.` it sounds like there is a timing issue and the element you want to write text into isn’t available. It’s a valid object since it worked for the other runs.

You can use the `waitForElement ...` `watiForPageLoad` or `waitForJQueryLoad` commands

---

<div class="post-metadata">

**Author:** ![usekatalon](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/usekatalon/32/16103_2.png) [@usekatalon](https://forum.katalon.com/u/usekatalon)\
**Post date:** [September 27, 2019, 5:40pm UTC](https://forum.katalon.com/t/unable-to-execute-the-script-thru-excel-with-25-records/33874/10 "2019-09-27T17:40:18Z")

</div>

thanks…working fine after giving the timeout for waitForElementVisible and will try the above options also later.

---

<div class="post-metadata">

**Author:** ![usekatalon](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/usekatalon/32/16103_2.png) [@usekatalon](https://forum.katalon.com/u/usekatalon)\
**Post date:** [September 27, 2019, 5:42pm UTC](https://forum.katalon.com/t/unable-to-execute-the-script-thru-excel-with-25-records/33874/11 "2019-09-27T17:42:40Z")

</div>

thanks a lot ehernandez 🙂
