Skip to content
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

Terminal commands on new element api should return actual result from Selenium. #3899

Open
garg3133 opened this issue Aug 24, 2023 · 5 comments · May be fixed by #4155
Open

Terminal commands on new element api should return actual result from Selenium. #3899

garg3133 opened this issue Aug 24, 2023 · 5 comments · May be fixed by #4155

Comments

@garg3133
Copy link
Member

garg3133 commented Aug 24, 2023

Terminal commands like click(), sendKeys(), etc. available on the new element API should return the result as returned by Selenium instead of returning a WebElement, as was the case with the commands available on the older element API.

Right now, these commands return a ScopedWebElement instance when used without await, which is not useful at all. And on using await with these commands, a WebElement instance of the previous element is returned, which also does not make any sense since the terminal commands are not meant to be chained.

Instead, the exact result as returned by Selenium should be reported back to the users (which is null for most of these commands).

This is also important because right now due to this, errors from Selenium are also not reported back to the users.

image

This can potentially be solved by reverting this commit, and here is a discussion related to this change.

@yashPratp983
Copy link
Contributor

@garg3133 I want to work on this issue.

@garg3133
Copy link
Member Author

Sure @yashPratp983, this issue could be a little tricky to get started with but you can surely give it a try.

What we want here right now is for commands to just return the error if some error has occurred, returning WebElement in case of a success if fine right now.

@garg3133
Copy link
Member Author

@yashPratp983 Were you able to make any progress on this?

@oohsai
Copy link

oohsai commented Mar 1, 2024

can you explain on how to re-create these errors? I've started to work on it

@dikwickley dikwickley linked a pull request Mar 26, 2024 that will close this issue
9 tasks
@Ashu463
Copy link

Ashu463 commented Mar 29, 2024

Hey @garg3133 I just hit a way to solve this one i.e. to put a check over the result returning from selenium, whether it consists of any errors, if yes, then return that error else return by default WebElement object. Is it OK to solve ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

4 participants