Closed sebv closed 12 years ago
Sounds good to me, admc?
Yeah all of these sound reasonable, any idea of ruby and python do this? I would overall like to have similar behavior between the projects.
I googled around the ruby behavior, and It probably throws a 'Not Found' exception. That would make sense since sending exception around has a big impact on performances (even more when using Sauce Labs), the whole page being included, so best not to encourage users to do it.
So best would probably to keep the element methods as if, and add hasElement and elementOrNull methods which are implemented using the elements (with s) method which just return an empty if the element do not exists.
Concerning the parameter default, this is part of JsonWire spec. I didn't noticed, but those kind of issues where fixed 2 days ago when I reformatted the code. This was due to the callback being identified as the 4th argument (in moveTo) before, and now the builder automatically looks in the last argument and finds it, no matter how many arguments. So I just wrote extra unit tests for these case and that's it.
Fantastic, I agree that sending entire exceptions and page content across the wire is a terrible idea. So lets keep things the way they are and go with adding a couple methods (hasElement and elementOrNull) to take care of the needed functionality.
Thanks for starting the convo!
Ok done, added see element/elements section in the doc.
Also made it generic to add/test this kind of element function in the future.
Seb.
Just wondering admc and other view on this possible enhancements: