nightwatch
nightwatch copied to clipboard
Terminal commands on new element api should return actual result from Selenium.
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.
This can potentially be solved by reverting this commit, and here is a discussion related to this change.
@garg3133 I want to work on this issue.
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.
@yashPratp983 Were you able to make any progress on this?
can you explain on how to re-create these errors? I've started to work on it
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 ?