I get an “Object is null” error when I get a network error (my project is not on my local machine) or if I don’t have the correct spelling of the object in the OR (or if I deleted the object but forgot that I said No to have all references removed). Can you start with that?
Also, does that “Potential Duplicates Found” message have to be resolved before you can carry on or is that what you want to use the Arrow Down on?
WebUI.delay(1)
WebUI.setText(findTestObject(‘Page_Create New Appraisal Anow/input__googleAddress’), ‘12 York St, Toronto, ON M5J 0A9, Canada’)
WebUI.delay(1)
WebUI.sendKeys(findTestObject(‘Page_Create New Appraisal Anow/input__googleAddress’), Keys.chord(Keys.ARROW_DOWN, Keys.ENTER))
edited my original post that was typed on mobile. You may need to adjust delays to suit. Also, your sendKeys step will click arrow down and enter at the same time I think… if this is not what you want, you may need to duplicate that line and send ARROW_DOWN first and then send ENTER.
when I copied your code Im getting this error “Description Resource Path Location Type
expecting ‘)’, found ‘New’ @ line 26, column 43. Script1641242845632.groovy /C%%Users%atapi%Katalon Studio%Anow%Anow.prj/Scripts/Quick Appraisal line 26 Groovy type checking problem”
I just ran it again and I got object is null as well.
regarding the potential duplicate found message that is a message if the same address is on the account. I can change the address and I wont get that message.
I don’t want to mislead you in that the null object is TO, but you can check it out. Like, how did you define it?
Also, you need to ensure any code copied from this forum does not have curly quotes, but straight quotes, like below:
WebUI.delay(1)
WebUI.setText(findTestObject('Page_Create New Appraisal Anow/input__googleAddress'), '12 York St, Toronto, ON M5J 0A9, Canada')
WebUI.delay(1)
WebUI.sendKeys(findTestObject('Page_Create New Appraisal Anow/input__googleAddress'), Keys.chord(Keys.ARROW_DOWN, Keys.ENTER))
Just a bit of background. Likely, you got this from using the Web Spy: findTestObject('Page_Create New Appraisal Anow/input__googleAddress')
Notice the name of your element above is in quotes and is somewhat descriptive, like “input” and what page it was found on.
Compare that to the below TO element: WebUI.sendKeys(TO, Keys...
The TO element has no descriptive name in quotes, no indication what type of element it is and no page information. This is not an element created by the Web Spy. This is a variable that was likely created by “Copy and Paste” from somewhere and put into your code. Instead, use the code that I formatted from @Dan_Bown. See if that works.
Also note the warning that Dan has in his post about wait times and your Keys being issued together.
Test Cases/Quick Appraisal FAILED.
Reason:
groovy.lang.MissingPropertyException: No such property: TO for class: Script1641242845632
at Quick Appraisal.run(Quick Appraisal:28)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText
If you are having the same concern that I have every-so-often about entering a reference and then KS makes it disappear, then add another line below your reference. TO should come back and then you just delete the extra row you created and save the change.
Personally, in this case, I think it is so much easier to just use the findTestObject phrase as you are just adding an extra layer doing the variable lookup.