Jump to content

Recommended Posts

Posted (edited)

Thanks to @water we have this summary of functions from InternetExplorer UDF which I initially / partially supplemented with the indication of adequate functions from au3WebDriver UDF.

Here is the link:

https://www.autoitscript.com/wiki/WebDriver#Translate_IE_UDF_to_WebDriver

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 3/7/2022 at 5:57 PM, mLipok said:

I said:

Not to top of your own script.

Expand  

I update the wd_core.au3 

Syntax Error:

"C:\AutoIt\AutoIt3\Include\File.au3"(323,42) : error: FileFindNextFile() [built-in] called with wrong number of args.
                $sName = FileFindNextFile($hSearch, 1)
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\AutoIt\AutoIt3\Include\wd_core.au3 - 1 error(s), 0 warning(s)

wd_core.au3 -> Exit Code: 2    (Laufzeit: 3.87 sec)

 

Posted
  On 3/7/2022 at 2:43 PM, mLipok said:

Take a look here:

 

 

Expand  

 

  On 3/7/2022 at 8:53 PM, mLipok said:

Thanks to @water we have this summary of functions from InternetExplorer UDF which I initially / partially supplemented with the indication of adequate functions from au3WebDriver UDF.

Here is the link:

https://www.autoitscript.com/wiki/WebDriver#Translate_IE_UDF_to_WebDriver

Expand  

I will try the WD functions when I have time to update my Scripts, will take a lot time ;) I´m offline for a while now. Thanks so far

Posted (edited)

Hi, @Danp2 and others.
I've successfully configured a session with public proxy (no authentication), but it doesn't seem to work when i switch to private proxy (HTTP/IPv4 with username & password).
Here is my capabilities:

Local $sDesiredCapabilities = '{"capabilities":{"alwaysMatch":{"goog:chromeOptions":{"w3c":true,"excludeSwitches":["enable-automation"]},"proxy":{"proxyType":"manual","httpProxy":"username:password@ip:port"}}}}'

Formatted JSON:

{
    "capabilities": {
        "alwaysMatch": {
            "goog:chromeOptions": {
                "w3c": true,
                "excludeSwitches": ["enable-automation"]
            },
            "proxy": {
                "proxyType": "manual",
                "httpProxy": "username:password@ip:port"
            }
        }
    }
}

Edit: I've also tried to add "http://username:password@ip:port", still failed to set the proxy. And i guaranteed that the proxy and its authentication infos are valid and working.
Edit2: I've tried to use postman and directly send request to chromedriver.exe but still achieve the same result.
So at this point im thinking is the "httpProxy" property being wrongly formatted?
image.thumb.png.49a84c223ca53caf89b42a37614f7d33.png
Edit3: The driver accept the private proxy but without providing username:password and prompted to enter them later on. So are there any workarounds to automatically login using some kind of url scheme like "username:password@ip:port" ?

Any ideas or suggestions would be greatly appreciated. Thanks!

Edited by sylremo
Add extra infos
Posted
  On 3/8/2022 at 9:22 AM, NolleWed said:

I update the wd_core.au3 

Syntax Error:

"C:\AutoIt\AutoIt3\Include\File.au3"(323,42) : error: FileFindNextFile() [built-in] called with wrong number of args.
                $sName = FileFindNextFile($hSearch, 1)
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\AutoIt\AutoIt3\Include\wd_core.au3 - 1 error(s), 0 warning(s)

wd_core.au3 -> Exit Code: 2    (Laufzeit: 3.87 sec)

 

Expand  


Which version of AutoIt you are using ?

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)
  On 3/8/2022 at 10:32 AM, sylremo said:

Hi, @Danp2 and others.
I've successfully configured a session with public proxy (no authentication), but it doesn't seem to work when i switch to private proxy

Expand  

try to use _WD_CapabilitiesAdd
 

_WD_CapabilitiesAdd('alwaysMatch')
_WD_CapabilitiesAdd('acceptInsecureCerts', True)

_WD_CapabilitiesAdd('firstMatch', 'chrome')
_WD_CapabilitiesAdd('browserName', 'chrome')
_WD_CapabilitiesAdd('w3c', True)
_WD_CapabilitiesAdd('args', 'user-agent', 'Mozilla/5.0 (Windows NT 10.0; Win' & StringReplace(@OSArch, 'X', '') & '; ' & @CPUArch & ') AppleWebKit/537.36 (KHTML, like Gecko) Chrome/' & _WD_GetBrowserVersion('chrome') & ' Safari/537.36')
_WD_CapabilitiesAdd('args', '--disable-blink-features=AutomationControlled')
_WD_CapabilitiesAdd('args', '--disable-web-security')
_WD_CapabilitiesAdd('args', '--allow-running-insecure-content') ; https://stackoverflow.com/a/60409220
_WD_CapabilitiesAdd('args', '--ignore-certificate-errors') ; https://stackoverflow.com/a/60409220
_WD_CapabilitiesAdd('prefs', 'credentials_enable_service', False) ; https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12272021/?do=findComment&comment=1464829
_WD_CapabilitiesAdd('timeouts', 'script', 300) ; https://www.w3.org/TR/webdriver/#timeouts
_WD_CapabilitiesAdd('timeouts', 'pageLoad', 30000) ; https://www.w3.org/TR/webdriver/#timeouts
_WD_CapabilitiesAdd('timeouts', 'implicit', 4) ; https://www.w3.org/TR/webdriver/#timeouts
If $_EXAMPLE_OPTION_PROXY Then
    _WD_CapabilitiesAdd('proxy', 'proxyType', 'manual')
    _WD_CapabilitiesAdd('proxy', 'proxyAutoconfigUrl', '127.0.0.1') ; change '127.0.0.1' to your own 'proxyAutoconfigUrl' host
    _WD_CapabilitiesAdd('proxy', 'ftpProxy', '127.0.0.1') ; change '127.0.0.1' to your own 'ftpProxy' host
    _WD_CapabilitiesAdd('proxy', 'httpProxy', '127.0.0.1') ; change '127.0.0.1' to your own 'httpProxy' host
    _WD_CapabilitiesAdd('proxy', 'noProxy', 'www.w3.org') ; an example url which should not to bo opened via proxy server
    _WD_CapabilitiesAdd('proxy', 'noProxy', 'www.autoitscript.com') ; an example url which should not to bo opened via proxy server
    _WD_CapabilitiesAdd('proxy', 'noProxy', 'www.google.com') ; an example url which should not to bo opened via proxy server
    _WD_CapabilitiesAdd('proxy', 'noProxy', 'www.google.pl') ; an example url which should not to bo opened via proxy server
    _WD_CapabilitiesAdd('proxy', 'sslProxy', '127.0.0.1') ; change '127.0.0.1' to your own 'sslProxy' host
    _WD_CapabilitiesAdd('proxy', 'socksProxy', '127.0.0.1') ; change '127.0.0.1' to your own 'socksProxy' host
    _WD_CapabilitiesAdd('proxy', 'socksVersion', 1)
EndIf

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 3/8/2022 at 11:49 AM, mLipok said:

try to use _WD_CapabilitiesAdd

Expand  

Make no differences.

  On 3/8/2022 at 10:32 AM, sylremo said:

Edit3: The driver accept the private proxy but without providing username:password and prompted to enter them later on. So are there any workarounds to automatically login using some kind of url scheme like "username:password@ip:port" ?

image.png.85ca5fc962215f34e31b0f79382840ce.png

Any ideas or suggestions would be greatly appreciated. Thanks!

Expand  

 

Posted

@Danp2 could you take a look on this solution: https://stackoverflow.com/a/55582859/5314940

I'm not so good in this kind of things.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

So my question is do you think that it is possible to do the same magic with AutoIt using au3WebDriver UDF  ?

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

what about using: _WD_Alert() ?

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

I've recently notice that

_WD_Option('Port', $iPort)

did nothing, chromedriver still use 9515 and 4444 for geckodriver instead of the port i specified in _WD_Option.
Then i slightly modified run command in _WD_Startup

$iPID = Run($sCommand & " --port " & $_WD_PORT, "", ($_WD_DEBUG = $_WD_DEBUG_Info) ? @SW_SHOW : @SW_HIDE)

It works perfectly for gecko since geckodriver doesnt support multiple sessions, but chromedriver does and chromedriver doesn't support "--port" and refused to start if enable this param. So i think refactoring this section might be a good idea.

Posted (edited)

Okay so http and ssl proxy required some extra python codes to automatically login

  On 3/8/2022 at 12:23 PM, mLipok said:

@Danp2 could you take a look on this solution: https://stackoverflow.com/a/55582859/5314940

I'm not so good in this kind of things.

Expand  

but for private SOCKS5, chrome doesn't prompt to enter any credentials, thats weird (ofc with no authentication equals not working). Then I've done some google searches, they said that chromedriver doesnt support SOCKS5 proxy with authentication natively.
So then what are those "socksUsername, socksPassword" properties key in proxy JSON node? https://github.com/shs96c/wiki-move/blob/master/DesiredCapabilities.md#proxy-json-object
I know this md is last updated in 2015 but was SOCKS5 authentication deprecated? Im really confused... 

Edited by sylremo
Posted
  On 3/8/2022 at 2:50 PM, sylremo said:

http and ssl proxy required some extra python AutoIt codes to automatically login

Expand  

only examples in the link requires python codes.
 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 3/8/2022 at 2:50 PM, sylremo said:

So then what are those "socksUsername, socksPassword" properties key in proxy JSON node? https://github.com/shs96c/wiki-move/blob/master/DesiredCapabilities.md#proxy-json-object
I know this md is last updated in 2015 but was SOCKS5 authentication deprecated? Im really confused... 

Expand  

if you take a look again on: https://stackoverflow.com/q/55582136/5314940

Then you find out that user which was asking this question already uses:

  Quote
capabilities['proxy'] = {'proxyType': 'MANUAL',
                             'httpProxy': proxy['address'],
                             'ftpProxy': proxy['address'],
                             'sslProxy': proxy['address'],
                             'noProxy': '',
                             'class': "org.openqa.selenium.Proxy",
                             'autodetect': False,
                             'socksUsername': proxy['username'],
                             'socksPassword': proxy['password']}
Expand  

So I immediately assumed it didn't work.

But if you want you can try to use:

_WD_CapabilitiesAdd('proxy', 'socksUsername', "*****")
_WD_CapabilitiesAdd('proxy', 'socksPassword', "*****")

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 3/8/2022 at 3:00 PM, mLipok said:

So I immediately assumed it didn't work.

But if you want you can try to use:

_WD_CapabilitiesAdd('proxy', 'socksUsername', "*****")
_WD_CapabilitiesAdd('proxy', 'socksPassword', "*****")

 

Expand  

I even use Postman to directly sent post request to chromedriver, the driver itself actually ignores "socksUsername" and "socksPassword" image.thumb.png.fc4399417500b7b5a7b126821f87fc02.png
 as i also give gecko a try and it said that both of those properties are invalid. 

image.png.cba6457d50a72fa2377c2c5c5cda8f11.png

Posted (edited)
  On 3/8/2022 at 2:56 PM, mLipok said:

only examples in the link requires python codes.
 

Expand  

I dont see any autoit implementation of this problem. With private ssl and http proxy, how exactly can i log in automatically? _WD_Alert() is not working in this case.

_WD_Alert ==> No alert present: {"value":{"error":"no such alert","message":"no such alert\n ...

Edit: The login prompt presence is unknown by the UDF, the only temp solution that i can think of is Sleep for couple seconds then use Send to fill in the form since its automatically focus the input field when i WinActivate chrome window, but if in some scenario where the login prompt for some reason not showing up (proxy died) or showing up late (after Sleep) or i simply just want to run in headless mode... I need a more robust solution.

Edited by sylremo
Posted
  On 3/8/2022 at 4:13 PM, sylremo said:

I dont see any autoit implementation of this problem.

Expand  

Because you are the first one asking for :)

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...