Closed mlipok closed 2 years ago
Instead of if ( !( IsDisabled || IsHidden ) && Matching )
, wouldn't it be more optimized to reverse the checking, ie:
if ( Matching && !( IsDisabled || IsHidden ) )
?
Taking that a step further, you should calculate Matching
first. If it is False, then there's no reason to continue with further calculations / checks for disabled or hidden.
- You appear to be using tabs instead of spaces in some areas. This creates some unusual indenting such as here --
Unusual indenting are visible only on GitHub but in SciTE editor it looks like:
- Instead of
if ( !( IsDisabled || IsHidden ) && Matching )
, wouldn't it be more optimized to reverse the checking, ie:if ( Matching && !( IsDisabled || IsHidden ) )
?- Taking that a step further, you should calculate
Matching
first. If it is False, then there's no reason to continue with further calculations / checks for disabled or hidden.
Please take a look at: Matching logic changed
Pull request
Proposed changes
Case Insensivity as requested here: https://github.com/Danp2/au3WebDriver/pull/377#issuecomment-1218443860 Code is refactored to use the same JS variable names, and the same JS coding style
Checklist
Types of changes
Please check
x
the type of change your PR introduces:What is the current behavior?
if you use
instead
then you will get error=
$_WD_ERROR_NoMatch
What is the new behavior?
no error, element is selected
Additional context
https://github.com/Danp2/au3WebDriver/pull/377#issuecomment-1218443860
System under test
not related