-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix terminal command now return actual result from Selenium #4155
base: main
Are you sure you want to change the base?
Fix terminal command now return actual result from Selenium #4155
Conversation
Status
|
@garg3133 can you review this? thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error we get here should ideally be similar to what we get when using the old API commands likebrowser.click()
.
@@ -23,5 +23,5 @@ | |||
* @returns {ScopedWebElement} | |||
*/ | |||
module.exports.command = function() { | |||
return this.runQueuedCommand('clickElement'); | |||
return this.runQueuedCommand('clickElement', {isTerminal: true}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dikwickley For this, we don't need to introduce any new flag because all terminal commands call this.runQueuedCommand()
method so we can use that to make our changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e381fd6
to
46a24ce
Compare
46a24ce
to
0c45852
Compare
Fixes: #3899
Fixes: dikwickley/gsoc24#1
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:
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
);