Jump to content

How to suppress file browser upload dialog?


Recommended Posts

Hello, I want to upload files automatically to  platforms.

On all platforms file upload is done like this: drag & drop or click on a text like "click to upload"

and then the browser file dialog starts (you can see it at the attachment).

But I want to uplaod without drag & drop and without browser dialog.

I read in an excel table in AutoIt with file directories and names and want to

upload them independently in a separate browser. But with a popping up browser file dialog

windows I can't do this. So is there a way to upload files without browser file open dialog in AutoIt?

Can I set it in $sDesiredCapabilities?

And how can I then upload the files without the browser dialog?

(I can't  change the code for upload directly (but indirectly?) because I'm not the owner of the platforms.)

 

TP_Upload_window.jpg

Edited by AI123
Link to post
Share on other sites
  • 4 weeks later...

Hello, I failed to compile wd_demo.au3. I downloaded it at https://github.com/Danp2/WebDriver/blob/master/wd_demo.au3.

First I had to include <WinAPIShPath.au3>. Otherwise I got a _WinAPI_UrlCombine(): undefined function error.

And I get a error: _WD_DownloadFile(): undefined function error.

The C:\Program Files (x86)\AutoIt3\Include\wd_helper.au3 hasn't this function.
I saw it was from 2018. So I replaced it with the version of 2020 I found
here https://raw.githubusercontent.com/Danp2/WebDriver/master/wd_helper.au3.
There the function is _WD_DownloadFile() included.

But I get now these errors:

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /NoStatus /prod /in "D:\Dokumente\FragenAntworten\AutoIt\T-Shirt-Scripte-Aktuell\wd_demo_2.au3"
+>20:04:03 Starting AutoIt3Wrapper v.18.708.1148.0 SciTE v.4.1.0.0   Keyboard:00000407  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:0407)  CodePage:0  utf8.auto.check:4
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\q\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\q\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.14.5)  from:C:\Program Files (x86)\AutoIt3  input:D:\Dokumente\FragenAntworten\AutoIt\T-Shirt-Scripte-Aktuell\wd_demo_2.au3
"C:\Program Files (x86)\AutoIt3\Include\wd_helper.au3"(954,34) : warning: $_WD_ERROR_InvalidArgue: possibly used before declaration.
        $iErr = $_WD_ERROR_InvalidArgue
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\wd_helper.au3"(1301,32) : error: __WD_CloseDriver() called with wrong number of args.
            __WD_CloseDriver($sDriverEXE)
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\wd_core.au3"(1437,24) : REF: definition of __WD_CloseDriver().
Func __WD_CloseDriver()
~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\wd_helper.au3"(1368,30) : warning: $_WD_ERROR_NotFound: possibly used before declaration.
        $iErr = $_WD_ERROR_NotFound
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\wd_helper.au3"(1445,44) : warning: $_WD_HTTPTimeOuts possibly not declared/created yet
            $_WD_HTTPTimeOuts[3] = $iPageLoad + 1000
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\wd_helper.au3"(1718,69) : warning: $_WD_IFILTER: possibly used before declaration.
        $aTable = _HtmlTableGetWriteToArray($sHTML, 1, False, $_WD_IFILTER)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\wd_helper.au3"(954,34) : error: $_WD_ERROR_InvalidArgue: undeclared global variable.
        $iErr = $_WD_ERROR_InvalidArgue
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\wd_helper.au3"(1368,30) : error: $_WD_ERROR_NotFound: undeclared global variable.
        $iErr = $_WD_ERROR_NotFound
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\wd_helper.au3"(1718,69) : error: $_WD_IFILTER: undeclared global variable.
        $aTable = _HtmlTableGetWriteToArray($sHTML, 1, False, $_WD_IFILTER)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\wd_helper.au3"(355,58) : error: __WD_ConsoleWrite(): undefined function.
        __WD_ConsoleWrite($sFuncName & ': ' & $sElement & @CRLF)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\wd_helper.au3"(978,43) : error: __WD_StripPath(): undefined function.
    Local $sFile = __WD_StripPath($_WD_DRIVER)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Dokumente\FragenAntworten\AutoIt\T-Shirt-Scripte-Aktuell\wd_demo_2.au3 - 6 error(s), 4 warning(s)
!>20:04:03 AU3Check ended. Press F4 to jump to next error.rc:2
+>20:04:03 AutoIt3Wrapper Finished.
>Exit code: 2    Time: 0.9445

So do I have to replace more au3 files in my C:\Program Files (x86)\AutoIt3\Include directory?

And which ones? My installed AutIt version is v3.3.14.5.

I thought if I reinstall AutoIt I could get the newest files in C:\Program Files (x86)\AutoIt3\Include.

But that's not the case I get then for example the old wd_helper.au3 from 2018 in the include directory.

So can you ore someone else please say me what I have to do to compile wd_demo.au3 without errors?

 

Link to post
Share on other sites

Sounds like you've got a mess. Generally, you don't put 3rd party or personal include files into the same directory as Autoit's "default" UDFs. See here for the preferred way to do it.

To obtain the latest release of the Webdriver UDF, you should always go here -- https://github.com/Danp2/WebDriver/releases/latest (same as in my sig)

FWIW, I don't experience these errors that you posted.

Link to post
Share on other sites
1 hour ago, Danp2 said:

Sounds like you've got a mess. Generally, you don't put 3rd party or personal include files into the same directory as Autoit's "default" UDFs. See here for the preferred way to do it.

To obtain the latest release of the Webdriver UDF, you should always go here -- https://github.com/Danp2/WebDriver/releases/latest (same as in my sig)

FWIW, I don't experience these errors that you posted.

Thank you, now I brought all to work. wd_demo.au3 compiles and run now.

Link to post
Share on other sites

I tried now to upload a file to a platform with AutoIt. But the last step doesn't work.

The file can't be uploaded. If I do it manually - choose a file or use drag and drop - the platform works the progress bar

bottom to the file name fills up and the file is uploading. But with my script the progress bar doesn't fill and file don't upload:

FileUploadProgressBarHaengt.jpg.ab1c77ad4fc3a6b54b9812332df4fd0e.jpg

This is my code:

; Click on "Weitere Designs hochladen oder einfach hierherziehen"
Local $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//div/div[1]/ui-view/div/div/div/div/div[2]/div[1]/a/div/h4[1]")

_WD_ElementAction($sSession, $sElement, 'click')

Sleep(1000)

; Select file
_WD_SelectFiles($sSession, $_WD_LOCATOR_ByXPath, "//*[@id='listFileInput']", $filepath & "\" & $local_imagename)
;_WD_SelectFiles($sSession, $_WD_LOCATOR_ByXPath, "//html/body/div/div[1]/ui-view/div/div/div/div/div[2]/div[1]/a/div", $filepath & "\" & $local_imagename)

; Upload file:
Local $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//div/div/div/div[2]/div/label/h2")
;Local $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//div/div[1]/ui-view/div/input")
_WD_ElementAction($sSession, $sElement, 'click')

So why could the upload be pending?

Link to post
Share on other sites

I get an "is not clickable error":

_WD_SelectUploadFile: 1 file(s) selected
_WD_SelectUploadFile ==> Success
__WD_Post: URL=HTTP://127.0.0.1:9515/session/b3d0cf2a41127755e290b6137d197e32/element; $sData={"using":"xpath","value":"//div/div/div/div[2]/div/label/h2"}
__WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"ac20b0cf-0e41-49c3-b1a4-471e63aa831f"}}...
_WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"ac20b0cf-0e41-49c3-b1a4-471e63aa831f"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/b3d0cf2a41127755e290b6137d197e32/element/ac20b0cf-0e41-49c3-b1a4-471e63aa831f/click; $sData={"id":"ac20b0cf-0e41-49c3-b1a4-471e63aa831f"}
__WD_Post: StatusCode=400; ResponseText={"value":{"error":"element click intercepted","message":"element click intercepted: Element \u003Ch2...
__WD_Post ==> Element interaction issue: {"value":{"error":"element click intercepted","message":"element click intercepted: Element \u003Ch2 data-v-1cb3d672=\"\">...\u003C/h2> is not clickable at point (516, 410). Other element would receive the click: \u003Ch2 data-v-1cb3d672=\"\">...\u003C/h2>\n  (Session info: chrome=87.0.4280.88)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00C6C013+3194899]\n\tOrdinal0 [0x00B56021+2056225]\n\tOrdinal0 [0x009EF608+587272]\n\tOrdinal0 [0x0097ED18+126232]\n\tOrdinal0 [0x0097DEB0+122544]\n\tOrdinal0 [0x0097CA7A+117370]\n\tOrdinal0 [0x0097C13E+115006]\n\tOrdinal0 [0x00975919+88345]\n\tOrdinal0 [0x0098FD73+195955]\n\tOrdinal0 [0x00975766+87910]\n\tOrdinal0 [0x0098FE5A+196186]\n\tOrdinal0 [0x00999B22+236322]\n\tOrdinal0 [0x0098FC1B+195611]\n\tOrdinal0 [0x00973B7F+80767]\n\tOrdinal0 [0x00974B4E+84814]\n\tOrdinal0 [0x00974AD9+84697]\n\tOrdinal0 [0x00B6CE64+2149988]\n\tGetHandleVerifier [0x00DDBE95+1400773]\n\tGetHandleVerifier [0x00DDBB61+1399953]\n\tGetHandleVerifier [0x00DE31FA+1430314]\n\tGetHandleVerifier [0x00DDC69F+1402831]\n\tOrdinal0 [0x00B63D61+2112865]\n\tOrdinal0 [0x00B6E5CB+2155979]\n\tOrdinal0 [0x00B6E6F5+2156277]\n\tOrdinal0 [0x00B7F26E+2224750]\n\tBaseThreadInitThunk [0x750DFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x772675F4+228]\n\tRtlGetAppContainerNamedObjectPath [0x772675C4+180]\n"}}
_WD_ElementAction: {"value":{"error":"element click intercepted","message":"element click intercepted: Element \u003Ch2...
_WD_ElementAction ==> Element interaction issue: {"value":{"error":"element click intercepted","message":"element click intercepted: Element \u003Ch2 data-v-1cb3d672=\"\">...\u003C/h2> is not clickable at point (516, 410). Other element would receive the click: \u003Ch2 data-v-1cb3d672=\"\">...\u003C/h2>\n  (Session info: chrome=87.0.4280.88)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00C6C013+3194899]\n\tOrdinal0 [0x00B56021+2056225]\n\tOrdinal0 [0x009EF608+587272]\n\tOrdinal0 [0x0097ED18+126232]\n\tOrdinal0 [0x0097DEB0+122544]\n\tOrdinal0 [0x0097CA7A+117370]\n\tOrdinal0 [0x0097C13E+115006]\n\tOrdinal0 [0x00975919+88345]\n\tOrdinal0 [0x0098FD73+195955]\n\tOrdinal0 [0x00975766+87910]\n\tOrdinal0 [0x0098FE5A+196186]\n\tOrdinal0 [0x00999B22+236322]\n\tOrdinal0 [0x0098FC1B+195611]\n\tOrdinal0 [0x00973B7F+80767]\n\tOrdinal0 [0x00974B4E+84814]\n\tOrdinal0 [0x00974AD9+84697]\n\tOrdinal0 [0x00B6CE64+2149988]\n\tGetHandleVerifier [0x00DDBE95+1400773]\n\tGetHandleVerifier [0x00DDBB61+1399953]\n\tGetHandleVerifier [0x00DE31FA+1430314]\n\tGetHandleVerifier [0x00DDC69F+1402831]\n\tOrdinal0 [0x00B63D61+2112865]\n\tOrdinal0 [0x00B6E5CB+2155979]\n\tOrdinal0 [0x00B6E6F5+2156277]\n\tOrdinal0 [0x00B7F26E+2224750]\n\tBaseThreadInitThunk [0x750DFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x772675F4+228]\n\tRtlGetAppContainerNamedObjectPath [0x772675C4+180]\n"}}
+>19:45:38 AutoIt3.exe ended.rc:0
+>19:45:38 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 21.04

 

Link to post
Share on other sites

At first I have to click on:

1409952651_WeitereDesignshochladen.jpg.338a34862877b0a1366e242d3137160b.jpg

This is the code for "Weitere Designs hochladen":

1484829986_WeitereDesignshochladenCode.thumb.jpg.97ddebaec0b0ec229d8e35b22963cbe2.jpg

 

After clicking on "Weitere Designs hochladen" I get this:

230015494_Designshochladen.jpg.8c6c84f74a079aebc0f75da154cdedc4.jpg

This is the code for "Design hochladen":

327347554_DesignshochladenCode.thumb.jpg.19207d9492b07339edc6d8b6caa7e6c6.jpg

After choosing the file this comes:

FileUploadProgressBarHaengt.jpg.900ce73cefe2e32e61a3efb0a2f0ffd9.jpg

It has this code:

1508286270_FileUploadProgressBarHaengtCode.thumb.jpg.683a23fbcd5c94005c89143b1ffb10b6.jpg

 

Edited by AI123
Link to post
Share on other sites
54 minutes ago, AI123 said:

I get an "is not clickable error"

Next time include these vital details so that we don't have to guess, ok? 😉

It appears that you are targeting the wrong element. Have you tried this one?

; Upload file:
Local $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//a[@id=upload-btn]")
_WD_ElementAction($sSession, $sElement, 'click')

 

Link to post
Share on other sites
21 minutes ago, Danp2 said:

Next time include these vital details so that we don't have to guess, ok? 😉

It appears that you are targeting the wrong element. Have you tried this one?

; Upload file:
Local $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//a[@id=upload-btn]")
_WD_ElementAction($sSession, $sElement, 'click')

 

Tried it and get an "Unable to locate element" error:

_WD_SelectUploadFile ==> Success
__WD_Post: URL=HTTP://127.0.0.1:9515/session/7932c4a00bc9a7f072c38aae42193b7a/element; $sData={"using":"xpath","value":"//a[@id=upload-btn]"}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\...
__WD_Post ==> No match: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//a[@id=upload-btn]\"}\n  (Session info: chrome=87.0.4280.88)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00C6C013+3194899]\n\tOrdinal0 [0x00B56021+2056225]\n\tOrdinal0 [0x009EF608+587272]\n\tOrdinal0 [0x0097B5A1+112033]\n\tOrdinal0 [0x0099B182+242050]\n\tOrdinal0 [0x0098FDAA+196010]\n\tOrdinal0 [0x00999B22+236322]\n\tOrdinal0 [0x0098FC1B+195611]\n\tOrdinal0 [0x00973B7F+80767]\n\tOrdinal0 [0x00974B4E+84814]\n\tOrdinal0 [0x00974AD9+84697]\n\tOrdinal0 [0x00B6CE64+2149988]\n\tGetHandleVerifier [0x00DDBE95+1400773]\n\tGetHandleVerifier [0x00DDBB61+1399953]\n\tGetHandleVerifier [0x00DE31FA+1430314]\n\tGetHandleVerifier [0x00DDC69F+1402831]\n\tOrdinal0 [0x00B63D61+2112865]\n\tOrdinal0 [0x00B6E5CB+2155979]\n\tOrdinal0 [0x00B6E6F5+2156277]\n\tOrdinal0 [0x00B7F26E+2224750]\n\tBaseThreadInitThunk [0x750DFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x772675F4+228]\n\tRtlGetAppContainerNamedObjectPath [0x772675C4+180]\n"}}
_WD_FindElement: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//a[@id=upload-btn]\"}\n  (Session info: chrome=87.0.4280.88)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00C6C013+3194899]\n\tOrdinal0 [0x00B56021+2056225]\n\tOrdinal0 [0x009EF608+587272]\n\tOrdinal0 [0x0097B5A1+112033]\n\tOrdinal0 [0x0099B182+242050]\n\tOrdinal0 [0x0098FDAA+196010]\n\tOrdinal0 [0x00999B22+236322]\n\tOrdinal0 [0x0098FC1B+195611]\n\tOrdinal0 [0x00973B7F+80767]\n\tOrdinal0 [0x00974B4E+84814]\n\tOrdinal0 [0x00974AD9+84697]\n\tOrdinal0 [0x00B6CE64+2149988]\n\tGetHandleVerifier [0x00DDBE95+1400773]\n\tGetHandleVerifier [0x00DDBB61+1399953]\n\tGetHandleVerifier [0x00DE31FA+1430314]\n\tGetHandleVerifier [0x00DDC69F+1402831]\n\tOrdinal0 [0x00B63D61+2112865]\n\tOrdinal0 [0x00B6E5CB+2155979]\n\tOrdinal0 [0x00B6E6F5+2156277]\n\tOrdinal0 [0x00B7F26E+2224750]\n\tBaseThreadInitThunk [0x750DFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x772675F4+228]\n\tRtlGetAppContainerNamedObjectPath [0x772675C4+180]\n"}}
_WD_FindElement ==> No match: HTTP status = 404
__WD_Post: URL=HTTP://127.0.0.1:9515/session/7932c4a00bc9a7f072c38aae42193b7a/element//click; $sData={"id":""}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"no such element: Element_id length is invalid\n  (Ses...
__WD_Post ==> No match: {"value":{"error":"no such element","message":"no such element: Element_id length is invalid\n  (Session info: chrome=87.0.4280.88)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00C6C013+3194899]\n\tOrdinal0 [0x00B56021+2056225]\n\tOrdinal0 [0x009EF608+587272]\n\tOrdinal0 [0x0097AE38+110136]\n\tOrdinal0 [0x0097C3F3+115699]\n\tOrdinal0 [0x0097585F+88159]\n\tOrdinal0 [0x0098FD73+195955]\n\tOrdinal0 [0x00975766+87910]\n\tOrdinal0 [0x0098FE5A+196186]\n\tOrdinal0 [0x00999B22+236322]\n\tOrdinal0 [0x0098FC1B+195611]\n\tOrdinal0 [0x00973B7F+80767]\n\tOrdinal0 [0x00974B4E+84814]\n\tOrdinal0 [0x00974AD9+84697]\n\tOrdinal0 [0x00B6CE64+2149988]\n\tGetHandleVerifier [0x00DDBE95+1400773]\n\tGetHandleVerifier [0x00DDBB61+1399953]\n\tGetHandleVerifier [0x00DE31FA+1430314]\n\tGetHandleVerifier [0x00DDC69F+1402831]\n\tOrdinal0 [0x00B63D61+2112865]\n\tOrdinal0 [0x00B6E5CB+2155979]\n\tOrdinal0 [0x00B6E6F5+2156277]\n\tOrdinal0 [0x00B7F26E+2224750]\n\tBaseThreadInitThunk [0x750DFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x772675F4+228]\n\tRtlGetAppContainerNamedObjectPath [0x772675C4+180]\n"}}
_WD_ElementAction: {"value":{"error":"no such element","message":"no such element: Element_id length is invalid\n  (Ses...
_WD_ElementAction ==> No match: {"value":{"error":"no such element","message":"no such element: Element_id length is invalid\n  (Session info: chrome=87.0.4280.88)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00C6C013+3194899]\n\tOrdinal0 [0x00B56021+2056225]\n\tOrdinal0 [0x009EF608+587272]\n\tOrdinal0 [0x0097AE38+110136]\n\tOrdinal0 [0x0097C3F3+115699]\n\tOrdinal0 [0x0097585F+88159]\n\tOrdinal0 [0x0098FD73+195955]\n\tOrdinal0 [0x00975766+87910]\n\tOrdinal0 [0x0098FE5A+196186]\n\tOrdinal0 [0x00999B22+236322]\n\tOrdinal0 [0x0098FC1B+195611]\n\tOrdinal0 [0x00973B7F+80767]\n\tOrdinal0 [0x00974B4E+84814]\n\tOrdinal0 [0x00974AD9+84697]\n\tOrdinal0 [0x00B6CE64+2149988]\n\tGetHandleVerifier [0x00DDBE95+1400773]\n\tGetHandleVerifier [0x00DDBB61+1399953]\n\tGetHandleVerifier [0x00DE31FA+1430314]\n\tGetHandleVerifier [0x00DDC69F+1402831]\n\tOrdinal0 [0x00B63D61+2112865]\n\tOrdinal0 [0x00B6E5CB+2155979]\n\tOrdinal0 [0x00B6E6F5+2156277]\n\tOrdinal0 [0x00B7F26E+2224750]\n\tBaseThreadInitThunk [0x750DFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x772675F4+228]\n\tRtlGetAppContainerNamedObjectPath [0x772675C4+180]\n"}}
+>21:14:12 AutoIt3.exe ended.rc:0
+>21:14:12 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 21.07

 

Link to post
Share on other sites

Ok... so I left out the single quotes around the id. Try this instead --

; Upload file:
Local $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//a[@id='upload-btn']")
_WD_ElementAction($sSession, $sElement, 'click')

P.S. This is something that you could have fixed on your own with just a little effort. 😒

Link to post
Share on other sites
4 minutes ago, Danp2 said:

Ok... so I left out the single quotes around the id. Try this instead --

; Upload file:
Local $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//a[@id='upload-btn']")
_WD_ElementAction($sSession, $sElement, 'click')

P.S. This is something that you could have fixed on your own with just a little effort. 😒

Sorry, haven't seen it. Now the element is found but I get an "is not clickable" message:

_WD_SelectUploadFile: 1 file(s) selected
_WD_SelectUploadFile ==> Success
__WD_Post: URL=HTTP://127.0.0.1:9515/session/62855c90e7a0558679360d9b60815f41/element; $sData={"using":"xpath","value":"//a[@id='upload-btn']"}
__WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"99577d02-e694-461e-b779-ead9286b233e"}}...
_WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"99577d02-e694-461e-b779-ead9286b233e"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/62855c90e7a0558679360d9b60815f41/element/99577d02-e694-461e-b779-ead9286b233e/click; $sData={"id":"99577d02-e694-461e-b779-ead9286b233e"}
__WD_Post: StatusCode=400; ResponseText={"value":{"error":"element click intercepted","message":"element click intercepted: Element \u003Ca ...
__WD_Post ==> Element interaction issue: {"value":{"error":"element click intercepted","message":"element click intercepted: Element \u003Ca data-v-5289d32e=\"\" href=\"#\" id=\"upload-btn\" class=\"upload-button\">...\u003C/a> is not clickable at point (446, 370). Other element would receive the click: \u003Cdiv data-v-1cb3d672=\"\" class=\"modal-container idea-upload-dialog\">...\u003C/div>\n  (Session info: chrome=87.0.4280.88)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00C6C013+3194899]\n\tOrdinal0 [0x00B56021+2056225]\n\tOrdinal0 [0x009EF608+587272]\n\tOrdinal0 [0x0097ED18+126232]\n\tOrdinal0 [0x0097DEB0+122544]\n\tOrdinal0 [0x0097CA7A+117370]\n\tOrdinal0 [0x0097C13E+115006]\n\tOrdinal0 [0x00975919+88345]\n\tOrdinal0 [0x0098FD73+195955]\n\tOrdinal0 [0x00975766+87910]\n\tOrdinal0 [0x0098FE5A+196186]\n\tOrdinal0 [0x00999B22+236322]\n\tOrdinal0 [0x0098FC1B+195611]\n\tOrdinal0 [0x00973B7F+80767]\n\tOrdinal0 [0x00974B4E+84814]\n\tOrdinal0 [0x00974AD9+84697]\n\tOrdinal0 [0x00B6CE64+2149988]\n\tGetHandleVerifier [0x00DDBE95+1400773]\n\tGetHandleVerifier [0x00DDBB61+1399953]\n\tGetHandleVerifier [0x00DE31FA+1430314]\n\tGetHandleVerifier [0x00DDC69F+1402831]\n\tOrdinal0 [0x00B63D61+2112865]\n\tOrdinal0 [0x00B6E5CB+2155979]\n\tOrdinal0 [0x00B6E6F5+2156277]\n\tOrdinal0 [0x00B7F26E+2224750]\n\tBaseThreadInitThunk [0x750DFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x772675F4+228]\n\tRtlGetAppContainerNamedObjectPath [0x772675C4+180]\n"}}
_WD_ElementAction: {"value":{"error":"element click intercepted","message":"element click intercepted: Element \u003Ca ...
_WD_ElementAction ==> Element interaction issue: {"value":{"error":"element click intercepted","message":"element click intercepted: Element \u003Ca data-v-5289d32e=\"\" href=\"#\" id=\"upload-btn\" class=\"upload-button\">...\u003C/a> is not clickable at point (446, 370). Other element would receive the click: \u003Cdiv data-v-1cb3d672=\"\" class=\"modal-container idea-upload-dialog\">...\u003C/div>\n  (Session info: chrome=87.0.4280.88)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00C6C013+3194899]\n\tOrdinal0 [0x00B56021+2056225]\n\tOrdinal0 [0x009EF608+587272]\n\tOrdinal0 [0x0097ED18+126232]\n\tOrdinal0 [0x0097DEB0+122544]\n\tOrdinal0 [0x0097CA7A+117370]\n\tOrdinal0 [0x0097C13E+115006]\n\tOrdinal0 [0x00975919+88345]\n\tOrdinal0 [0x0098FD73+195955]\n\tOrdinal0 [0x00975766+87910]\n\tOrdinal0 [0x0098FE5A+196186]\n\tOrdinal0 [0x00999B22+236322]\n\tOrdinal0 [0x0098FC1B+195611]\n\tOrdinal0 [0x00973B7F+80767]\n\tOrdinal0 [0x00974B4E+84814]\n\tOrdinal0 [0x00974AD9+84697]\n\tOrdinal0 [0x00B6CE64+2149988]\n\tGetHandleVerifier [0x00DDBE95+1400773]\n\tGetHandleVerifier [0x00DDBB61+1399953]\n\tGetHandleVerifier [0x00DE31FA+1430314]\n\tGetHandleVerifier [0x00DDC69F+1402831]\n\tOrdinal0 [0x00B63D61+2112865]\n\tOrdinal0 [0x00B6E5CB+2155979]\n\tOrdinal0 [0x00B6E6F5+2156277]\n\tOrdinal0 [0x00B7F26E+2224750]\n\tBaseThreadInitThunk [0x750DFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x772675F4+228]\n\tRtlGetAppContainerNamedObjectPath [0x772675C4+180]\n"}}
+>22:27:19 AutoIt3.exe ended.rc:0
+>22:27:19 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 21.75

 

Link to post
Share on other sites
  • 3 months later...

Did you find solution ?

Signature beginning:
Please remember: "AutoIt".....  Wondering who uses AutoIt and what it can be used for ?
* GHAPI UDF - modest beginning - communication with GitHub REST API Forum Rules *
Include Dependency Tree (Tool for analyzing script relations)
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) *

PDF Related:How to get reference to PDF object embeded in IE *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2021-03-17

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...