Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wd_demo.au3 - SetupOpera() suplemented + fixes #218

Merged
merged 9 commits into from
Feb 26, 2022
Merged

wd_demo.au3 - SetupOpera() suplemented + fixes #218

merged 9 commits into from
Feb 26, 2022

Conversation

mlipok
Copy link
Contributor

@mlipok mlipok commented Feb 23, 2022

Pull request

Proposed changes

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.

Please ensure you have read and noticed the checklist below.

Checklist

Put an x in the boxes that apply. If you're unsure about any of them, don't hesitate to ask. We are here to help!

This is simply a reminder of what we are going to look for before merging your code.

  • I have read and noticed the CODE OF CONDUCT document
  • I have read and noticed the CONTRIBUTING document
  • I have added necessary documentation or screenshots (if appropriate)

Types of changes

Please check x the type of change your PR introduces:

  • Bugfix (change which fixes an issue)
  • Feature (change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (functional, structural)
  • Documentation content changes
  • Other (please describe)

What is the current behavior?

$aBrowsers have issues.
SetupOpera() was only a draft.

What is the new behavior?

fixed $aBrowsers
Suplemented SetupOpera()

Additional context

Add any other context about the problem here.
#187

System under test

Opera

@mlipok mlipok marked this pull request as draft February 23, 2022 21:10
@mlipok
Copy link
Contributor Author

mlipok commented Feb 23, 2022

as I said here:
#217 (comment)
and
#217 (comment)

it is needed to merge
#217
and
#218
to:
https://github.com/Danp2/au3WebDriver/tree/supportOpera

and observe the issue on this tree which is for us only a DRAFT for #213

There is some issue with operadriver.exe behavior or in my understanding the code.
But you need merged https://github.com/Danp2/au3WebDriver/tree/supportOpera
to test my code changes with wd_demo.au3 which I propose here.

@mlipok mlipok marked this pull request as ready for review February 23, 2022 21:20
@mlipok
Copy link
Contributor Author

mlipok commented Feb 23, 2022

There is some issue with creating capabilities for operadriver.exe so I want to create $sCapabilities manually.
Thus my PR: SetupOpera - not using _WD_Capabilities*

@mlipok
Copy link
Contributor Author

mlipok commented Feb 23, 2022

This issue was disscused before here:

https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-02222022/?do=findComment&comment=1383791

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

Using the following capabilities string but not with "alwaysMatch"

Func SetupOpera($bHeadless)
	#forceref $bHeadless
	_WD_Option('Driver', 'operadriver.exe')
	_WD_Option('Port', 9515)
	_WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\opera.log"')

	Local $sCapabilities = '{"capabilities": {"alwaysMatch": {"operaOptions": {"excludeSwitches": [ "enable-automation"]}}}}'
	#Region - for testing stage only
;~ 	$sCapabilities = "{}"
;~ 	$sCapabilities = '{"capabilities":{}}'
;~ 	$sCapabilities = '{"capabilities":{"operaOptions": {}}}'
	$sCapabilities = '{"capabilities":{"operaOptions": {"w3c":true}}}'
;~ 	$sCapabilities = '{"capabilities":{"operaOptions": {"w3c":true, "binary": "C:\\Users\\agatk\\AppData\\Local\\Programs\\Opera\\opera.exe"}}}'
	#EndRegion - for testing stage only
	Return $sCapabilities
EndFunc   ;==>SetupOpera

I always get Missing or invalid capabilities :

> _WD_CreateSession
__WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities":{"operaOptions": {"w3c":true}}}
__WD_Post: StatusCode=200; ResponseText={"sessionId":"04c4bdb0f9a0286c680a0f6c2ec8c456","status":33,"value":{"message":"session not created:...
_WD_CreateSession: {"sessionId":"04c4bdb0f9a0286c680a0f6c2ec8c456","status":33,"value":{"message":"session not created: Missing or invalid capabilities\n  (Driver info: operadriver=98.0.4758.82 (199fc4f2ce08413e0126f4e98393232412a76ab6-refs/branch-heads/4758@{#974}),platform=Windows NT 10.0.22000 x86_64)"}}
_WD_CreateSession ==> Webdriver Exception: session not created: Missing or invalid capabilities
  (Driver info: operadriver=98.0.4758.82 (199fc4f2ce08413e0126f4e98393232412a76ab6-refs/branch-heads/4758@{#974}),platform=Windows NT 10.0.22000 x86_64)
! Error = 10 occured on: Demo
! $_WD_HTTPRESULT = 200
! $_WD_SESSION_DETAILS = 

"alwaysMatch" is definitely out of place, as if the difference between Opera <> Chrome was significant in this regard.

@mlipok
Copy link
Contributor Author

mlipok commented Feb 23, 2022

btw.
I was used this reference as a guide:
https://github.com/operasoftware/operachromiumdriver/blob/master/docs/desktop.md

@mlipok
Copy link
Contributor Author

mlipok commented Feb 25, 2022

Thanks to @Danp2 findings from here: #220 (comment)

I'm going back to work on wd_demo.au3

I also posted issue here:
operasoftware/operachromiumdriver#98

wd_demo.au3 Outdated Show resolved Hide resolved
- Revert $aBrowsers declaration change
- typo
@Danp2 Danp2 merged commit b096230 into Danp2:supportOpera Feb 26, 2022
@mlipok mlipok deleted the patch-3 branch February 26, 2022 20:12
Danp2 added a commit that referenced this pull request Mar 2, 2022
* Array of supported browsers

* _WD_GetBrowserVersion: Eliminate hardcoding

* _WD_UpdateDriver: Partial elimination of hardcoding

* wd_demo.au3 Opera first commit (#214)

* Expand and move Support Browsers array

* Implement $_WD_BROWSER* enum

* Utilize $_WD_BROWSER_Name

* __WD_CapabilitiesInitialize + 'operaOptions' (#217)

* __WD_CapabilitiesInitialize + 'operaOptions'

* using $_WD_SupportedBrowsers

* 'edge' >> 'msedge' ScriptBreakingChange

* Readme update for opera (#216)

* wd_core.au3 - operaOptions > goog:chromeOptions (#221)

related to @Danp2  findings:
#220 (comment)

* added _WD_GetBrowserPath() with Opera path support (#223)

* _WD_GetBrowserPath: Eliminate browser specific code

* _WD_UpdateDriver: Support alternate browser location (#226)

* wd_demo.au3 - SetupOpera() suplemented + fixes (#218)

* Update change log (#230)

* Fix [Unreleased] header

* Update CHANGELOG.md

* _WD_UpdateDriver: Eliminate remaining hardcoding (#231)

* Expand $_WD_SupportedBrowsers
* Add __WD_GetLatestWebdriverInfo
* _WD_UpdateDriver: Use __WD_GetLatestWebdriverInfo

* OPERA:  _WD_GetBrowserVersion/Path refactoring (#235)

* $_WD_ERROR_NotSupported 

* using $iIndex = @Extended

* OPERA: _WD_UpdateDriver + __WD_UpdateExtractor (#236)

* Opera final proposals (#237)

Co-authored-by: Michał Lipok <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants