Logical operators (AND &&, OR ||, NOT !) in selectors

Hi All,

It would be good to have support for logical operators (and, or, not) in selectors.

Scenario:

  • Workflow operating on one application
  • There can be multiple windows open at the same time
  • One of the windows displays Purchase Orders (can be distinguished by header which can contain contain either “PO” or “Purchase Order”)
  • Developer needs to ensure the robot executes actions within the order window

Currently:
two separate element exists actions are required to test both *PO* and *Purchase Order* selectors separately

Proposed:
one selector
*PO*||*Purchase Order*
which would match against both of the scenarios

Please upvote if you’d find that feature useful!

Best Regards,
Filip

Hi @Filip_C, you can use two Element Exist activity to check the selector come with your option.
Use If Condition and navigate to your page.

TanQ,
Michael Udhaya

Hi @Michael_Udhaya,

Thanks for your comment :slight_smile:!
To be honest, that’s what I meant in Current section

Currently:
two separate element exists actions are required to test both PO and Purchase Order selectors separately

While it most certainly does solve the problem it’s far from perfect (especially when there’s more than two conditions to be met); having these options in selectors would leave more space in the workflow for actual business logic and would make the whole workflow less cluttered :slight_smile:

Kind of similar situation to what we’ve had with variables … prior 19.4 we were able to break the selector string and inject a variable and it worked just fine… yet now we have {{variable}} support built into selectors :slight_smile:

Best Regards,
Filip

4 Likes

Hi @amaresan,

Thank you for your input :slight_smile:

Yes, the parallel activity will slightly improve the performance but that’s not the main concern. It would still require jumping through hoops just to check if a header with either or / both and exists

I know most of the time there will be a workaround but at the end of the day we should not need to use workarounds - It’s purely case of readability, maintainability, and developer experience

Best Regards,
Filip

1 Like

Hi @Filip_C

I believe our team is looking at the possibility of allowing regex in selectors. No hard promises on when it will enter Studio though :slight_smile:

4 Likes

Hi @loginerror,

Thanks for the update :slight_smile:
Having RegEx selectors would be a blast!:boom:

Cheers,
Filip

1 Like

@gheorghestan

Stay tuned, the RegEx support will be delivered soon. For the beginning you’ll have to manually write the regular expression directly in the selector’s xml string. The UI tools will be updated next year.

For the mentioned case, below is the regex correct syntax you need to use:

(. * PO. * )|(. * Purchase Order. * ) - remove the space before and after each * before usage

Should you have questions, do let me know!

Regards
Gheorghe

3 Likes

thanks

1 Like

Hi @Filip_C

Please check out these topics of recently introduced new features!

3 Likes

@loginerror,

Nice one! well done!

Cheers,
Filip

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.