Fix terminal command now return actual result from Selenium #4155
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #3899
Solved this issue by keeping a special flag for terminal commands. Instead of returning WebElement, if there was an error thrown by Selenium that is passed.
Example Test:
output:
![Screenshot 2024-03-27 at 3 47 58 AM](https://private-user-images.githubusercontent.com/31622972/317058809-b97021cd-8539-4367-9087-1f8243c8e9a6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA3NTMyODAsIm5iZiI6MTcyMDc1Mjk4MCwicGF0aCI6Ii8zMTYyMjk3Mi8zMTcwNTg4MDktYjk3MDIxY2QtODUzOS00MzY3LTkwODctMWY4MjQzYzhlOWE2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzEyVDAyNTYyMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNhMzRkNzZiZmU2ZDE1NmVjMzMyZmE1MTEwMjdmYWVkYmUwMWMyZGI1NjVlNWU0MTEyMzdjYTA0NzUwNDlmMGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ZIkjpwM3QjJIYJE2CCgjfRLq4vfhDO-xu7xX67bHSU8)
Thanks in advance for your contribution. Please follow the below steps in submitting a pull request, as it will help us with reviewing it quicker.
examples/tests
directory of the project) and running them.ecosia.js
andduckDuckGo.js
are good examples to work with.features/my-new-feature
orissue/123-my-bugfix
);