Danp2 / au3WebDriver

Web Driver UDF for AutoIt
MIT License
107 stars 21 forks source link

chrome >> chrome_legacy - automatically supported #484

Closed mlipok closed 1 year ago

mlipok commented 1 year ago

Pull request

Proposed changes

chrome >> chrome_legacy - should be automatically supported user should not bother about this

Checklist

Types of changes

What is the current behavior?

you need to check which version of Chrome browser you have and specify this by choosing chrome or chrome_legacy

What is the new behavior?

chrome >> chrome_legacy - automatically done

Additional context

https://www.autoitscript.com/forum/topic/208640-webdriver-udf-help-support-iv/?do=findComment&comment=1521299

https://www.autoitscript.com/forum/topic/208640-webdriver-udf-help-support-iv/?do=findComment&comment=1521377

System under test

Chrome Browser v114... v115

REMARK

consider to check for $_WD_SupportedBrowsers if there is a need to add accordingly some additionall checking

Danp2 commented 1 year ago

What is the current behavior? you need to check which version of Chrome browser you have and specify this by choosing chrome or chrome_legacy

True, which is by design. The chrome_legacy entry will be removed in the near future once everyone has had the opportunity to upgrade to newer versions of Chrome.

Since this check can be easily performed by the executing script, I don't see why _WD_UpdateDriver needs to be "bastardized" by adding these browser specific changes.

P.S. I suggest that you start using draft PRs until they are ready for review. 😛

mlipok commented 1 year ago

So as I understand your statement user should check it by his own route, for example with such a snippet:

Local $sBrowserVersion = _WD_GetBrowserVersion($sBrowser)
If Not @error And $sBrowser = "chrome" Then
  Local $i_Check = _VersionCompare("115.0.0.0", $sBrowserVersion)
  If Not @error And $i_Check = 1 Then $sBrowser = "chrome_legacy"
EndIf
_WD_UpdateDriver($sBrowser, Default, Default, True)

EDIT: or even better:

_Example('chrome')

Func _Example($sBrowser)
     Local $sBrowserVersion = _WD_GetBrowserVersion($sBrowser)
    If Not @error And $sBrowser = "chrome" Then
        Local $i_Check = _VersionCompare("115.0.0.0", $sBrowserVersion)
        If Not @error And $i_Check = 1 Then $sBrowser = "chrome_legacy"
    EndIf
    _WD_UpdateDriver($sBrowser)
EndFunc
mlipok commented 1 year ago

The chrome_legacy entry will be removed in the near future once everyone has had the opportunity to upgrade to newer versions of Chrome.

Why in near future ? I would like to prospose to leave this functionality as long as chromedriver.exe download links are available/active.

Danp2 commented 1 year ago

So as I understand your statement user should check it by his own route

There are several way to tackle this problem --

Why in near future ? I would like to prospose to leave this functionality as long as chromedriver.exe download links are available/active.

For multiple reasons --

mlipok commented 1 year ago

Ok. I have one more concept to check and propose here, and we will be able to close this PR in max next 2 days.

mlipok commented 1 year ago

As for now it can be closed.