# Upload Image on Instagram

**URL:** <https://forum.katalon.com/t/upload-image-on-instagram/59646>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [October 31, 2021, 5:31am UTC](https://forum.katalon.com/t/upload-image-on-instagram/59646 "2021-10-31T05:31:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryan](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/ryan/32/16104_2.png) [@ryan](https://forum.katalon.com/u/ryan)\
**Post date:** [October 31, 2021, 5:31am UTC](https://forum.katalon.com/t/upload-image-on-instagram/59646/1 "2021-10-31T05:31:20Z")

</div>

Hi Katalon Team! Does anyone have tried the upload image on Instagram using the web? I used sendkeys for upload of an image, and I got an error below.

Instagram modal for upload image:

 ![Create new post • Instagram 2021-10-31 at 1.28.04 PM](https://europe1.discourse-cdn.com/katalon/original/3X/e/e/ee87266e59539e4902289ef769059029dc0f1e14.jpeg)

Note: I tried to click the 'Select from computer" first then I’ll send (using sendkeys) the path of the image file, but I still encounter an error. Is there another way how can successfully upload the image? Thank you!

```
=============== ROOT CAUSE =====================

Caused by: org.openqa.selenium.ElementNotInteractableException: element not interactable

At object: 'Object Repository/Home Page_Instagram/Select from computer'

For trouble shooting, please visit: https://docs.katalon.com/katalon-studio/docs/troubleshooting.html

================================================

10-31-2021 01:12:25 PM Test Cases/Instagram

Elapsed time: 42.642s

Test Cases/Instagram FAILED.

Reason:

com.kms.katalon.core.exception.StepFailedException: Unable to send keys '/Users/ryanp.escal/Downloads/katalonss.jpg' to object 'Object Repository/Home Page_Instagram/Select from computer'

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.SendKeysKeyword.sendKeys(SendKeysKeyword.groovy:60)

at com.kms.katalon.core.webui.keyword.builtin.SendKeysKeyword.execute(SendKeysKeyword.groovy:38)

at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)

at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.sendKeys(WebUiBuiltInKeywords.groovy:864)

at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$sendKeys$3.call(Unknown Source)

at Instagram.run(Instagram:38)

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

at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:421)

at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:400)

at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:392)

at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:273)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:142)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:133)

at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)

at TempTestCase1635657127535.run(TempTestCase1635657127535.groovy:25)

Caused by: org.openqa.selenium.ElementNotInteractableException: element not interactable

(Session info: chrome=95.0.4638.69)

Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'

System info: host: 'Ryans-MacBook-Pro.local', ip: '2404:3c00:40bf:d320:0:0:0:4%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.16', java.version: '1.8.0_275'

Driver info: com.kms.katalon.selenium.driver.CChromeDriver

Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 95.0.4638.69, chrome: {chromedriverVersion: 94.0.4606.61 (418b78f5838ed..., userDataDir: /var/folders/5m/dtcm1fqx701...}, goog:chromeOptions: {debuggerAddress: localhost:61082}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: MAC, platformName: MAC, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true}

Session ID: 9b1bc264bf49371449bbfa26a4ee7e0d

at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)

at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)

at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)

at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)

at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)

at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)

at com.kms.katalon.selenium.driver.CChromeDriver.execute(CChromeDriver.java:19)

at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:285)

at org.openqa.selenium.remote.RemoteWebElement.sendKeys(RemoteWebElement.java:106)

at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement.lambda$new$0(EventFiringWebDriver.java:404)

at com.sun.proxy.$Proxy11.sendKeys(Unknown Source)

at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement.sendKeys(EventFiringWebDriver.java:429)

at com.kms.katalon.core.webui.keyword.builtin.SendKeysKeyword$_sendKeys_closure1.doCall(SendKeysKeyword.groovy:53)

at com.kms.katalon.core.webui.keyword.builtin.SendKeysKeyword$_sendKeys_closure1.call(SendKeysKeyword.groovy)

at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)

... 17 more

```

---

<div class="post-metadata">

**Author:** ![ThanhTo](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thanhto/32/697_2.png) [@ThanhTo](https://forum.katalon.com/u/ThanhTo)\
**Post date:** [October 31, 2021, 6:13am UTC](https://forum.katalon.com/t/upload-image-on-instagram/59646/2 "2021-10-31T06:13:55Z")

</div>

You may wanna try `Upload File by Drag-and-Drop` keyword.

> **[\[WebUI\] Upload File by Drag-and-Drop](https://docs.katalon.com/katalon-studio/docs/webui-upload-file-drag-and-drop.html)**
>
> Your Katalon Studio version must be 7.5.0+. Precondition: For the keyword to work, the drop zone must be visible before it is used. uploadFileWithDragAndDrop Description: Upload files to a website...

---

<div class="post-metadata">

**Author:** ![ryan](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/ryan/32/16104_2.png) [@ryan](https://forum.katalon.com/u/ryan)\
**Post date:** [October 31, 2021, 6:37am UTC](https://forum.katalon.com/t/upload-image-on-instagram/59646/3 "2021-10-31T06:37:22Z")

</div>

Hi Thanto, Thanks! There is no error already, but I got the file is not supported even though I am uploading a jpg file.

Note: I tried manually uploading the JPG file, and I successfully upload the image. Thank you!

 ![Create new post • Instagram 2021-10-31 at 2.34.16 PM](https://europe1.discourse-cdn.com/katalon/original/3X/a/3/a3cf33ae5c8a39ae867a405afc6b6a017ddd6809.jpeg)

My Code:

```
            WebUI.click(findTestObject('Home Page_Instagram/Click_Upload'))

            def filePath = RunConfiguration.getProjectDir() + '/pablo.jpg'

            WebUI.uploadFileWithDragAndDrop(findTestObject('Home Page_Instagram/Select from computer'), '/Users/ryanpl/Documents')

```

---

<div class="post-metadata">

**Author:** ![ThanhTo](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thanhto/32/697_2.png) [@ThanhTo](https://forum.katalon.com/u/ThanhTo)\
**Post date:** [October 31, 2021, 6:43am UTC](https://forum.katalon.com/t/upload-image-on-instagram/59646/4 "2021-10-31T06:43:33Z")

</div>

> [@ryan](#):
>
> WebUI.uploadFileWithDragAndDrop(findTestObject(‘Home Page\_Instagram/Select from computer’), ‘/Users/ryanpl/Documents’)

You need to pass the variable `filePath` instead of `/Users/ryanpl/Documents` into the keyword.

---

<div class="post-metadata">

**Author:** ![ryan](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/ryan/32/16104_2.png) [@ryan](https://forum.katalon.com/u/ryan)\
**Post date:** [October 31, 2021, 6:52am UTC](https://forum.katalon.com/t/upload-image-on-instagram/59646/5 "2021-10-31T06:52:04Z")

</div>

Thanks, Thanto! But I have a question, do I need to locate my image file to the getProjectDir? Because After I run, I got this error below.

My file is located on this path. Thank you!

`def filePath = RunConfiguration.getProjectDir() + '/Users/ryanp.escal/Documents/pablog.jpg'`

=============== ROOT CAUSE =====================

Caused by: org.openqa.selenium.InvalidArgumentException: invalid argument: File not found : /Users/ryanp.escal/Katalon Studio/Ryan Cafe24 exam/Users/ryanp.escal/Documents/pablog.jpg

---

<div class="post-metadata">

**Author:** ![ryan](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/ryan/32/16104_2.png) [@ryan](https://forum.katalon.com/u/ryan)\
**Post date:** [October 31, 2021, 7:04am UTC](https://forum.katalon.com/t/upload-image-on-instagram/59646/6 "2021-10-31T07:04:39Z")

</div>

Hi Thanto! I have fixed my issue, I relocated my image file to the project directory. Thank you so much!!

---

<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:** [October 31, 2021, 12:16pm UTC](https://forum.katalon.com/t/upload-image-on-instagram/59646/7 "2021-10-31T12:16:21Z")

</div>

I’m sorry to tell you this, @ryan, but you have not solved the problem. You have altered your input to accommodate your bug.

Let me say that a different way by asking you this question: will your users (who you are meant to be emulating) have a Katalon project folder?

The browser supports users uploading files _from any path available to them_. Your test should cover that.
