Unable to execute the script thru excel with 25 records

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?

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

hello,

how excel is read?

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 - :x: 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)

hi Hernandez

posted the logs in the below

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

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

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

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

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

thanks a lot ehernandez :slight_smile: