Danp2 / au3WebDriver

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

_WD_GetTable - $sBaseElement as CSSQuery #497

Closed mlipok closed 11 months ago

mlipok commented 11 months ago

Feature request

Is your feature request related to a problem?

Why only <table> element is located by XPath ? Why not supporting CSSQuery ?

Describe the solution you'd like

current:

Func _WD_GetTable($sSession, $sBaseElement, $sRowsSelector = Default, $sColsSelector = Default)

proposal:

Func _WD_GetTable($sSession, $sSelector, $sStrategy = $_WD_LOCATOR_ByXPath, $sRowsSelector = Default, $sColsSelector = Default)

Describe alternatives you've considered

none

Additional context

none

Danp2 commented 11 months ago

This would be a script breaking change

mlipok commented 11 months ago

I know, but the third and fourth parameters have been added to the UDF recently (they were only added a few months ago). Hardly anyone uses them other than in the Default value. Whoever uses them should be aware of this and should easily correct the code after reading RELEASE NOTES.

The benefits are considerable because we unify the way of using this function so that it works like others, i.e. we extend it from its current form to a more standard one (so that all element selection strategies are possible).

Danp2 commented 11 months ago

I agree (just wanted to document it).

proposal: Func _WD_GetTable($sSession, $sSelector, $sStrategy = $_WD_LOCATOR_ByXPath, $sRowsSelector = Default, $sColsSelector = Default)

The rest of the functions specify strategy, then selector, so I recommend changing this as well for consistency. I know this will mean more effort initially for anyone that currently uses _WD_GetTable, but I believe it is the correct move to make.

mlipok commented 11 months ago

Tomorrow I create PR