# Unable to upload using sendKeys

**URL:** <https://forum.katalon.com/t/unable-to-upload-using-sendkeys/94403>\
**Category:** Web Testing\
**Tags:** web-testing, file\
**Created:** [August 31, 2023, 8:35am UTC](https://forum.katalon.com/t/unable-to-upload-using-sendkeys/94403 "2023-08-31T08:35:26Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![consulting](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/consulting/32/24911_2.png) [@consulting](https://forum.katalon.com/u/consulting)\
**Post date:** [August 31, 2023, 8:35am UTC](https://forum.katalon.com/t/unable-to-upload-using-sendkeys/94403/1 "2023-08-31T08:35:26Z")

</div>

Hi,

I followed the instructions in [How to resolve file upload issues](http://forum.katalon.com/t/how-to-resolve-file-upload-issues/29812?u=consulting) but I am having no luck.

This is a web application.

Here’s where the script gets to:

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

The sendKeys statement executes but it doesn’t pick up the file.

When I check that the upload button is clickable, the script fails.

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/8/4/84a06cb2809395895ec7d2a537d604d89064ca4a.png)

Here’s the test script:

```auto
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import org.openqa.selenium.By
import org.openqa.selenium.WebDriver

import com.kms.katalon.core.configuration.RunConfiguration
import com.kms.katalon.core.model.FailureHandling
import com.kms.katalon.core.testobject.TestObject
import com.kms.katalon.core.webui.driver.DriverFactory
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

import internal.GlobalVariable
import com.kms.katalon.core.configuration.RunConfiguration as RunConfiguration

// Get the project directory
String dirName = RunConfiguration.getProjectDir()

//Construct full path to the first file
String filePath1 = (dirName + GlobalVariable.DataFileFolder) + file1

println('Full path to file : '+filePath1)

WebUI.callTestCase(findTestCase('Login/CVIP Login'), [:], FailureHandling.STOP_ON_FAILURE)

WebUI.click(findTestObject('Object Repository/AI Upload Supporting Document/Page_VIP/a_Inspectors'))

WebUI.click(findTestObject('Object Repository/AI Upload Supporting Document/Page_VIP/a_Search Inspectors'))

WebUI.verifyElementText(findTestObject('Object Repository/AI Upload Supporting Document/Page_VIP/h1_Search Authorized Inspector'), 
    'Search Authorized Inspector')

WebUI.setText(findTestObject('Object Repository/AI Upload Supporting Document/Page_VIP/input_Search Authorized Inspector_searchInput'), 
    '200019')

WebUI.click(findTestObject('Object Repository/AI Upload Supporting Document/Page_VIP/button_Search Authorized Inspector_btn btn-_60a73a'))

WebUI.verifyElementText(findTestObject('Object Repository/AI Upload Supporting Document/Page_VIP/td_Scripps, Bernie Michael'), 
    'Scripps, Bernie Michael')

WebUI.click(findTestObject('Object Repository/AI Upload Supporting Document/Page_VIP/a_200019'))

WebUI.verifyElementText(findTestObject('Object Repository/AI Upload Supporting Document/Page_VIP/h2_Scripps, Bernie Michael'), 
    'Scripps, Bernie Michael')

WebUI.click(findTestObject('Object Repository/AI Upload Supporting Document/Page_VIP/button_Add Document'))

WebUI.selectOptionByValue(findTestObject('Object Repository/AI Upload Supporting Document/Page_VIP/select_(Select One)Air Brake Training Endor_9f0947'), 
    'AB_TRAINING_ENDRSMT', true)

// let's see if this works
WebUI.sendKeys(findTestObject('FileUpload/FileUploadObject'), filePath1)

WebUI.verifyElementClickable(findTestObject('Object Repository/AI Upload Supporting Document/Page_VIP/button_Upload'))

WebUI.click(findTestObject('Object Repository/AI Upload Supporting Document/Page_VIP/button_Upload'))

WebUI.delay(3)

WebUI.verifyElementClickable(findTestObject('Object Repository/AI Upload Supporting Document/Page_VIP/button_Save'))
WebUI.click(findTestObject('Object Repository/AI Upload Supporting Document/Page_VIP/button_Save'))

```

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [August 31, 2023, 9:23am UTC](https://forum.katalon.com/t/unable-to-upload-using-sendkeys/94403/2 "2023-08-31T09:23:10Z")

</div>

> [@consulting](#):
>
> When I check that the upload button is clickable, the script fails.

Please show us the full log.

---

<div class="post-metadata">

**Author:** ![Dave\_Evers](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/dave_evers/32/435_2.png) [@Dave\_Evers](https://forum.katalon.com/u/Dave_Evers)\
**Post date:** [August 31, 2023, 3:17pm UTC](https://forum.katalon.com/t/unable-to-upload-using-sendkeys/94403/3 "2023-08-31T15:17:59Z")

</div>

Hi @consulting, See this posting: [How-to use ‘sendKeys’ or 'File Upload' to upload files](http://forum.katalon.com/t/how-to-use-sendkeys-or-file-upload-to-upload-files/54758)  
\*\*Please read the entire post.

---

<div class="post-metadata">

**Author:** ![consulting](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/consulting/32/24911_2.png) [@consulting](https://forum.katalon.com/u/consulting)\
**Post date:** [August 31, 2023, 5:48pm UTC](https://forum.katalon.com/t/unable-to-upload-using-sendkeys/94403/4 "2023-08-31T17:48:09Z")

</div>

Thanks 😀 - I followed the steps, updated the object and validated it.

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/3/c/3ca0d9bcc05b50a315f26aa9ea69a296466f42a8.png)

Here’s the updated object

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

I added the wait statement:

```auto
WebUI.waitForElementVisible(findTestObject('FileUpload/FileUploadObject'),30,FailureHandling.OPTIONAL)

```

We get to the statement where it waits but the element is never visible, so it times out.

Here’s the stack trace:

```auto
15: waitForElementVisible(findTestObject("FileUpload/FileUploadObject"), 30, OPTIONAL)
2023-08-31 10:35:56.705 WARN k.k.c.w.k.b.WaitForElementVisibleKeyword - Object 'Object Repository/FileUpload/FileUploadObject' is not visible after 30 second(s)
2023-08-31 10:35:56.706 DEBUG testcase.AI Upload Supporting Document - 16: sendKeys(findTestObject("FileUpload/FileUploadObject"), filePath1)
2023-08-31 10:35:57.078 DEBUG testcase.AI Upload Supporting Document - 17: verifyElementClickable(findTestObject("Object Repository/AI Upload Supporting Document/Page_VIP/button_Upload"))
2023-08-31 10:35:57.731 ERROR c.k.k.core.keyword.internal.KeywordMain - ❌ Object 'Object Repository/AI Upload Supporting Document/Page_VIP/button_Upload' is NOT clickable (Root cause: com.kms.katalon.core.exception.StepFailedException: Object 'Object Repository/AI Upload Supporting Document/Page_VIP/button_Upload' is NOT clickable
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
	at com.kms.katalon.core.webui.keyword.builtin.VerifyElementClickableKeyword$_verifyElementClickable_closure1.doCall(VerifyElementClickableKeyword.groovy:83)
	at com.kms.katalon.core.webui.keyword.builtin.VerifyElementClickableKeyword$_verifyElementClickable_closure1.call(VerifyElementClickableKeyword.groovy)
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
	at com.kms.katalon.core.webui.keyword.builtin.VerifyElementClickableKeyword.verifyElementClickable(VerifyElementClickableKeyword.groovy:96)
	at com.kms.katalon.core.webui.keyword.builtin.VerifyElementClickableKeyword.execute(VerifyElementClickableKeyword.groovy:67)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.verifyElementClickable(WebUiBuiltInKeywords.groovy:566)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$verifyElementClickable$9.call(Unknown Source)
	at AI Upload Supporting Document.run(AI Upload Supporting Document:50)
	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:448)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:144)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:135)
	at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
	at TempTestCase1693503308896.run(TempTestCase1693503308896.groovy:25)
)
2023-08-31 10:35:58.005 ERROR c.k.k.core.keyword.internal.KeywordMain - ❌ Unable to verify object 'Object Repository/AI Upload Supporting Document/Page_VIP/button_Upload' to be clickable (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to verify object 'Object Repository/AI Upload Supporting Document/Page_VIP/button_Upload' to be clickable
	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.VerifyElementClickableKeyword.verifyElementClickable(VerifyElementClickableKeyword.groovy:96)
	at com.kms.katalon.core.webui.keyword.builtin.VerifyElementClickableKeyword.execute(VerifyElementClickableKeyword.groovy:67)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.verifyElementClickable(WebUiBuiltInKeywords.groovy:566)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$verifyElementClickable$9.call(Unknown Source)
	at AI Upload Supporting Document.run(AI Upload Supporting Document:50)
	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:448)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:144)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:135)
	at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
	at TempTestCase1693503308896.run(TempTestCase1693503308896.groovy:25)
Caused by: com.kms.katalon.core.exception.StepFailedException: Object 'Object Repository/AI Upload Supporting Document/Page_VIP/button_Upload' is NOT clickable
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
	at com.kms.katalon.core.webui.keyword.builtin.VerifyElementClickableKeyword$_verifyElementClickable_closure1.doCall(VerifyElementClickableKeyword.groovy:83)
	at com.kms.katalon.core.webui.keyword.builtin.VerifyElementClickableKeyword$_verifyElementClickable_closure1.call(VerifyElementClickableKeyword.groovy)
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
	... 17 more
)
2023-08-31 10:35:58.007 ERROR c.k.katalon.core.main.TestCaseExecutor - ❌ Test Cases/AI Upload Supporting Document FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to verify object 'Object Repository/AI Upload Supporting Document/Page_VIP/button_Upload' to be clickable
	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.VerifyElementClickableKeyword.verifyElementClickable(VerifyElementClickableKeyword.groovy:96)
	at com.kms.katalon.core.webui.keyword.builtin.VerifyElementClickableKeyword.execute(VerifyElementClickableKeyword.groovy:67)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.verifyElementClickable(WebUiBuiltInKeywords.groovy:566)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$verifyElementClickable$9.call(Unknown Source)
	at AI Upload Supporting Document.run(AI Upload Supporting Document:50)
	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:448)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:144)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:135)
	at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
	at TempTestCase1693503308896.run(TempTestCase1693503308896.groovy:25)
Caused by: com.kms.katalon.core.exception.StepFailedException: Object 'Object Repository/AI Upload Supporting Document/Page_VIP/button_Upload' is NOT clickable
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
	at com.kms.katalon.core.webui.keyword.builtin.VerifyElementClickableKeyword$_verifyElementClickable_closure1.doCall(VerifyElementClickableKeyword.groovy:83)
	at com.kms.katalon.core.webui.keyword.builtin.VerifyElementClickableKeyword$_verifyElementClickable_closure1.call(VerifyElementClickableKeyword.groovy)
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
	... 17 more

2023-08-31 10:35:58.020 INFO c.k.katalon.core.main.TestCaseExecutor - END Test Cases/AI Upload Supporting Document

```

Any suggestions as to next steps?

---

<div class="post-metadata">

**Author:** ![Dave\_Evers](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/dave_evers/32/435_2.png) [@Dave\_Evers](https://forum.katalon.com/u/Dave_Evers)\
**Post date:** [August 31, 2023, 7:08pm UTC](https://forum.katalon.com/t/unable-to-upload-using-sendkeys/94403/5 "2023-08-31T19:08:40Z")

</div>

Hi @consulting,  
Your locator for **FileUploadObject** is: `//*[@id="fileButton" and @type="file"]` and works as expected. Do you have the correct locator for **button\_Upload** , it might be something like: `//*[@type="button" and contains(@id,'chooseFileBtn')]`

This example might help: [How-to use ‘sendKeys’ or 'File Upload' to upload files - #12 by Dave\_Evers - Tips & Tricks - Katalon Community](http://forum.katalon.com/t/how-to-use-sendkeys-or-file-upload-to-upload-files/54758/12?u=dave_evers)

See: [File Upload Sample - West Wind Web Connection](https://www.west-wind.com/wconnect/wcscripts/fileupload.wwd)  
The xpath for **Select images** is: //\*[@id=“upload” and @type=“file”]  
The xpath for **Upload** is: //button[starts-with(@type, ‘submit’) and contains(@class,‘btn’)]

 ![fileType](https://europe1.discourse-cdn.com/katalon/original/3X/3/b/3b1935dc46ef4169604254fec7d360e45910764b.png)  
 ![uploadBtn](https://europe1.discourse-cdn.com/katalon/original/3X/5/7/572054dba801ad246f0b639fe58723553077033b.png)

---

<div class="post-metadata">

**Author:** ![consulting](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/consulting/32/24911_2.png) [@consulting](https://forum.katalon.com/u/consulting)\
**Post date:** [September 1, 2023, 5:01pm UTC](https://forum.katalon.com/t/unable-to-upload-using-sendkeys/94403/6 "2023-09-01T17:01:06Z")

</div>

Thanks @Dave_Evers1 - I made some tweaks to the script and checked the objects using F12 and I can find it.

Normally the flow is user clicks an “Add Document” button. The “Add Supporting Document” modal appears and the user picks an entry from the Document Type dropdown, then clicks ‘Choose file’, browses to the file and selects it and then the file input filed gets filled in.

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/d/4/d4de2af20483a68c961974020f023d14b9ff7a16.png)

The sendKeys statement never executes as that hidden input never becomes visible.

I am wondering if this is a case of where the Devs need to re-think the file upload piece of code or if there’s another way.

I have used your example and run it against the same site and it works as expected. The only difference between the sample and the site I am testing is the popup window appearing.

Any suggestions?

```auto
WebUI.selectOptionByValue(findTestObject('Object Repository/AI Upload Supporting Document/Page_VIP/select_(Select One)Air Brake Training Endor_9f0947'), 
    'AB_TRAINING_ENDRSMT', true)

// let's see if this works
if (WebUI.waitForElementVisible(findTestObject('FileUpload/FileUploadObject'),10,FailureHandling.OPTIONAL)==true)
{
	WebUI.sendKeys(findTestObject('FileUpload/FileUploadObject'), filePath1)

	if (WebUI.verifyElementClickable(findTestObject('Object Repository/AI Upload Supporting Document/Page_VIP/button_Upload'))==true)
	{
		WebUI.click(findTestObject('Object Repository/AI Upload Supporting Document/Page_VIP/button_Upload'))
		WebUI.delay(3)
	
		if (WebUI.verifyElementClickable(findTestObject('Object Repository/AI Upload Supporting Document/Page_VIP/button_Save'))==true)
		{
			WebUI.click(findTestObject('Object Repository/AI Upload Supporting Document/Page_VIP/button_Save'))
		}
		else {
			println('ERROR: Unable to click the save button')
		}
	}
	else {
		println('ERROR: Unable to click the upload button')
	}
}
else
{
	println('ERROR: The file upload object did not become visible')
	assert false: "Unable to complete test - file upload object not visible"
}

```

---

<div class="post-metadata">

**Author:** ![Dave\_Evers](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/dave_evers/32/435_2.png) [@Dave\_Evers](https://forum.katalon.com/u/Dave_Evers)\
**Post date:** [September 1, 2023, 6:32pm UTC](https://forum.katalon.com/t/unable-to-upload-using-sendkeys/94403/7 "2023-09-01T18:32:51Z")

</div>

Hi @consulting (Jonathan),  
Have you tried using `document.querySelectorAll("input[type=file]")` to find the hidden element. See: [How-to use ‘sendKeys’ or 'File Upload' to upload files](http://forum.katalon.com/t/how-to-use-sendkeys-or-file-upload-to-upload-files/54758) for details.

---

<div class="post-metadata">

**Author:** ![consulting](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/consulting/32/24911_2.png) [@consulting](https://forum.katalon.com/u/consulting)\
**Post date:** [September 1, 2023, 9:03pm UTC](https://forum.katalon.com/t/unable-to-upload-using-sendkeys/94403/8 "2023-09-01T21:03:43Z")

</div>

Thanks @Dave_Evers - I followed both your posts to the letter - I can get them to work with the sample site.

For my target, I confirmed I have the right xpath statement as I tried to illustrate in the following image

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/8/9/89fdb089c63932a87ea02655aa0c49e10a0e6dcf.jpeg)

Running out of ideas and I haven’t seen any other posts in the forum or elsewhere for people having the same issue.

I am open to ideas… and THANK-YOU for all the time you have spent responding - much appreciated!!

---

<div class="post-metadata">

**Author:** ![Dave\_Evers](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/dave_evers/32/435_2.png) [@Dave\_Evers](https://forum.katalon.com/u/Dave_Evers)\
**Post date:** [September 1, 2023, 9:36pm UTC](https://forum.katalon.com/t/unable-to-upload-using-sendkeys/94403/9 "2023-09-01T21:36:13Z")

</div>

Jonathan, Why are you using == true  
Not sure it would cause any issues …

```auto
if (WebUI.waitForElementVisible(findTestObject('FileUpload/FileUploadObject'),10, FailureHandling.OPTIONAL)==true) {
    //Do something
}

```

And not:

```auto
if (WebUI.waitForElementVisible(findTestObject('FileUpload/FileUploadObject'), 10, FailureHandling.OPTIONAL)) {
    //Do something
}

```

Could your object(s) be inside an iframe?  
Use the DevTools (F12 ) console to search for any iframes:

```auto
document.querySelectorAll("iframe").length //iframe count
document.querySelectorAll("iframe") //displays actual frame(s)

```

Try it out here: [\<iframe\>: The Inline Frame element - HTML | MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe)

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

---

<div class="post-metadata">

**Author:** ![consulting](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/consulting/32/24911_2.png) [@consulting](https://forum.katalon.com/u/consulting)\
**Post date:** [September 2, 2023, 12:16am UTC](https://forum.katalon.com/t/unable-to-upload-using-sendkeys/94403/10 "2023-09-02T00:16:02Z")

</div>

Thanks for the suggestion - I removed the ==true (just a rookie thing) and re-ran the script - no change ☹

I also checked for iframes and it doesn’t look like there are any

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/2/8/28d7c7677452f0798d6de16d83848b7a0f7ebe21.png)

---

<div class="post-metadata">

**Author:** ![Dave\_Evers](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/dave_evers/32/435_2.png) [@Dave\_Evers](https://forum.katalon.com/u/Dave_Evers)\
**Post date:** [September 2, 2023, 1:02am UTC](https://forum.katalon.com/t/unable-to-upload-using-sendkeys/94403/11 "2023-09-02T01:02:20Z")

</div>

Hi @Russ_Thomas, Would you have any suggestions?

---

<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:** [September 2, 2023, 2:04am UTC](https://forum.katalon.com/t/unable-to-upload-using-sendkeys/94403/12 "2023-09-02T02:04:09Z")

</div>

@consulting

Use `WebUI.setText()` to populate the document field with your filename and path.

![image](https://europe1.discourse-cdn.com/katalon/original/3X/8/a/8a780e78bba0fd0488cfe705eb3b41b95afc1695.png)

Click the Upload button:

![image](https://europe1.discourse-cdn.com/katalon/original/3X/3/1/31a8061aaf715fec2632bd2e0f73faa4f05fbf97.png)

If that doesn’t work, we’re missing some key piece of information, somewhere.

A couple things I read that I wanted to comment on…

You referred to a “popup window”. It’s not a popup window. It’s likely just a div element hosting a bunch of HTML.

You said:

> [@consulting](#):
>
> I am wondering if this is a case of where the Devs need to re-think the file upload piece of code or if there’s another way.

If it works for users, it’s fine for testing. If you can’t test it, look to yourself, _first_.

As you discovered, it’s a waste of time checking visibility of elements with a `hidden` attribute.

---

<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:** [September 2, 2023, 2:34am UTC](https://forum.katalon.com/t/unable-to-upload-using-sendkeys/94403/13 "2023-09-02T02:34:53Z")

</div>

I just perused the HTML code… here’s what I found (though none of it helps with your current issue, it might be worth mentioning to the devs).

It has a broken structure. There is a `<script>` element as a first child of the document `<html>` element. That’s not legal HTML and makes a mockery of the `<!DOCTYPE>` preamble instruction. Whatever system the devs are using to build out there site, needs a thorough review.

![image](https://europe1.discourse-cdn.com/katalon/original/3X/d/6/d6ff708ba652a7d14fa7b9749fbd8b0034acdbbc.png)  
[\<html\>: The HTML Document / Root element - HTML | MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html)

Then I found this:

```html
<label>&nbsp;</label>

```

 ![23acc64acfbdc1bf125c6f08043085ed-2984302642](https://europe1.discourse-cdn.com/katalon/original/3X/d/4/d43f691a0c81a9302da2ba8950b8f665b51f86dc.jpeg)

Funniest HTML I’ve seen in a _looong_ time. That’s like, “Hmm, I need a little box type thing so I can keep some _`space`_ in it. I know! A car glove-box! Hmm. Where can I buy a car?”

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [September 5, 2023, 4:51am UTC](https://forum.katalon.com/t/unable-to-upload-using-sendkeys/94403/14 "2023-09-05T04:51:18Z")

</div>

> [@consulting](#):
>
> ```auto
> WebUI.selectOptionByValue(findTestObject('Object Repository/AI Upload Supporting Document/Page_VIP/select_(Select One)Air Brake Training Endor_9f0947'), 
> 'AB_TRAINING_ENDRSMT', true)
> 
> ```

Another thing that is for information only; you are using the boolean as **true** in the above statement. The **true** means you want to use RegEx (Regular Expression), but you do not have any Regular Expression characters in your reference, `'AB_TRAINING_ENDRSMT'`. You should change the boolean to **false** so you have a normal comparison.

A RegEx comparison would be like `^AB_T\\D{5-15}` or `AB_T.*`
