# Unexpected Token

**URL:** <https://forum.katalon.com/t/unexpected-token/28107>\
**Category:** Web Testing\
**Tags:** web-testing, katalon-studio\
**Created:** [June 19, 2019, 2:22am UTC](https://forum.katalon.com/t/unexpected-token/28107 "2019-06-19T02:22:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![marias](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@marias](https://forum.katalon.com/u/marias)\
**Post date:** [June 19, 2019, 2:22am UTC](https://forum.katalon.com/t/unexpected-token/28107/1 "2019-06-19T02:22:53Z")

</div>

I am trying to upload a file using a custom keyword but I am getting an “unexpected token” error in the script.

The upload keyword works in other tests but for some reason it is not working here.

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

How do I fix the unexpected token error?

Thanks!

---

<div class="post-metadata">

**Author:** ![marias](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@marias](https://forum.katalon.com/u/marias)\
**Post date:** [June 19, 2019, 3:58am UTC](https://forum.katalon.com/t/unexpected-token/28107/2 "2019-06-19T03:58:08Z")

</div>

Unexpected token is now starting to show up in other tests. I am not sure what’s going on. 😕

---

<div class="post-metadata">

**Author:** ![matt.thurman](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/matt.thurman/32/16103_2.png) [@matt.thurman](https://forum.katalon.com/u/matt.thurman)\
**Post date:** [June 19, 2019, 4:22am UTC](https://forum.katalon.com/t/unexpected-token/28107/3 "2019-06-19T04:22:42Z")

</div>

@marias Can you please post your full code, including the custom keyword, test, and full error message?

---

<div class="post-metadata">

**Author:** ![marias](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@marias](https://forum.katalon.com/u/marias)\
**Post date:** [June 20, 2019, 12:48am UTC](https://forum.katalon.com/t/unexpected-token/28107/4 "2019-06-20T00:48:40Z")

</div>

@matt.thurman

WebUI.openBrowser(’’)

WebUI.navigateToUrl(‘somethingsomethingwebsite’)

WebUI.click(findTestObject(‘Page\_evident Design/form\_User name’))

WebUI.setText(findTestObject(‘Object Repository/Page\_evident Design/input\_User name\_username’), ‘somethingsomething’)

WebUI.setEncryptedText(findTestObject(‘Object Repository/Page\_evident Design/input\_Password\_password’), ‘gkKKHHd7u4q8sLvsAburNQ==’)

WebUI.click(findTestObject(‘Object Repository/Page\_evident Design/button\_Sign in’))

// Click assign to me button  
WebUI.delay(5)

WebUI.click(findTestObject(‘Object Repository/Page\_Designer Dashboard/span\_Assign to me’))

WebUI.delay(10)

// Click download file button (double check the xpath recorded by recorder - sometimes it does not work/not correct syntax)  
WebUI.click(findTestObject(‘Object Repository/Page\_Designer Dashboard/span\_Download case file(s)’))

// Click submit case button  
WebUI.delay(10)

WebUI.click(findTestObject(‘Page\_Designer Dashboard/button\_Submit design files(s))’)

//file upload

CustomKeywords.‘testpackage.test.uploadFile2’(findTestObject(‘Page\_Designer Dashboard/upload\_case\_button’), ‘C:\Users\Nimbyx\Documents\Test\_Files\test\_case\_submit.zip’)

It won’t let me execute the script since I have “errors in the script” so I can’t attach the error log 😕 Thanks so much!!!

---

<div class="post-metadata">

**Author:** ![marias](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@marias](https://forum.katalon.com/u/marias)\
**Post date:** [June 20, 2019, 12:51am UTC](https://forum.katalon.com/t/unexpected-token/28107/5 "2019-06-20T00:51:45Z")

</div>

@matt.thurman

even if I remove the custom keyword line… the unexpected token error appears in the line before. Not too sure why.

---

<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:** [June 20, 2019, 5:18pm UTC](https://forum.katalon.com/t/unexpected-token/28107/6 "2019-06-20T17:18:40Z")

</div>

hi,

what Katalon Problems tab say?

---

<div class="post-metadata">

**Author:** ![Nilau](https://avatars.discourse-cdn.com/v4/letter/n/bb73d2/32.png) [@Nilau](https://forum.katalon.com/u/Nilau)\
**Post date:** [June 20, 2019, 6:27pm UTC](https://forum.katalon.com/t/unexpected-token/28107/7 "2019-06-20T18:27:28Z")

</div>

You’re missing a parenthesis. The line before your customkeyword.  
It should be :  
WebUI.click(findTestObject(‘Page\_Designer Dashboard/button\_Submit design files(s))’))

EDIT: I think the parenthesis is inside the object and should be outside, So it should be :

**WebUI.click(findTestObject(‘Page\_Designer Dashboard/button\_Submit design files(s)’))**

---

<div class="post-metadata">

**Author:** ![albert.vu](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/albert.vu/32/20595_2.png) [@albert.vu](https://forum.katalon.com/u/albert.vu)\
**Post date:** [August 8, 2022, 7:43am UTC](https://forum.katalon.com/t/unexpected-token/28107/8 "2022-08-08T07:43:42Z")

</div>

Archived on August 8, 2022, 7:43am UTC


