au3WebDriver icon indicating copy to clipboard operation
au3WebDriver copied to clipboard

_WD_LoadWait() enhancements

Open Danp2 opened this issue 2 years ago • 9 comments

I think we should provide new feature for _WD_LoadWait() as there can be cases that you would like to wait not for complete but for interactive or even loaded will be enough to continue processing like there was no error.

Reference: https://www.w3schools.com/jsref/prop_doc_readystate.asp

uninitialized - Has not started loading
loading - Is loading
loaded - Has been loaded
interactive - Has loaded enough to interact with
complete - Fully loaded

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

I know that pageLoadStrategy can be used in capability string https://www.w3.org/TR/webdriver2/#dfn-waiting-for-the-navigation-to-complete https://www.selenium.dev/documentation/webdriver/capabilities/shared/

But I mean that it would be helpfull to change _WD_LoadWait behavior on the fly without touching capabilities.

If you agree then I open separate Issue for this.

Originally posted by @mlipok in https://github.com/Danp2/au3WebDriver/issues/362#issuecomment-1225545526

Danp2 avatar Aug 24 '22 13:08 Danp2

Please treat this PR: 384 _WD_LoadWait - better error handling as separate things.

mlipok avatar Aug 24 '22 13:08 mlipok

btw. I have also a plan to: Add support for checking all frames in _WD_LoadWait but firstly 362 _WD_FrameList must be merged.

mlipok avatar Aug 24 '22 13:08 mlipok

Please treat this https://github.com/Danp2/au3WebDriver/pull/384 as separate things.

That was my plan. However, it seems to me that your changes in that PR go beyond "better error handling". IMO, that task could have been accomplished with this one line of code --

If $iErr Then $iErr = $_WD_ERROR_Exception

Danp2 avatar Aug 24 '22 14:08 Danp2

In my opinion $iExt is also related to ERROR handling. EDIT: Also $sMessage usage is related to ERROR handling.

mlipok avatar Aug 24 '22 14:08 mlipok

IMO those changes are related more to logging / debugging than error handling.

Danp2 avatar Aug 24 '22 14:08 Danp2

IMO those changes are related more to logging / debugging than error handling.

Agree. But this was my intention so I change the PR title to be more in line with the changes: From _WD_LoadWait - better error handling to _WD_LoadWait - better error handling and logging

mlipok avatar Aug 24 '22 19:08 mlipok

you can assign this issue to me

mlipok avatar Aug 24 '22 20:08 mlipok

I think we should provide new feature for _WD_LoadWait() as there can be cases that you would like to wait not for complete but for interactive or even loaded will be enough to continue processing like there was no error.

It was proposed here: https://github.com/Danp2/au3WebDriver/pull/392

Please keep further discussion in this regards in the mentioned PR

mlipok avatar Aug 28 '22 21:08 mlipok

btw. I have also a plan to: Add support for checking all frames in _WD_LoadWait but firstly 362 _WD_FrameList must be merged.

this part is still required to be done, as next step. And for this reason this issue still has to be open.

mlipok avatar Aug 28 '22 21:08 mlipok