SeleniumHQ / selenium-google-code-issue-archive

Archive, please see main selenium repo
https://github.com/seleniumhq/selenium
346 stars 194 forks source link

Proposal for selenium running interactively #3787

Closed lukeis closed 8 years ago

lukeis commented 8 years ago

Originally reported on Google Code with ID 3787

My main problem with classical selenium-junit approach is, that every time your test
scripts face an error, the junit test crashes, and you will need to fix the problem
and restart your tests. This long develop-test cycle eats away your time, and makes
writing test scripts very frustrating.

In my blog: http://jankesterblog.blogspot.de/ and in youtube movie http://www.youtube.com/watch?v=IlfLfLuceWk
I demonstrate how you can attach a groovy console to a selenium driver, and write and
execute your tests interactively.

Is this something that could be included into selenium project? I think with this kind
of tooling, Selenium can gain many new users.

Reported by jan.c.kester on 2012-04-23 19:43:19

lukeis commented 8 years ago
Thanks Jan for posting it.
I am  Using selenium since last 4 years and found interaction of Groovy console with
Selenium is very helpful for writing the test scripts.and it makes test writers life
very easy when we work in interactive mode with selenium.

~Bhushan

Reported by bhoo.ring on 2012-04-24 01:51:19

lukeis commented 8 years ago
I would post this to the selenium-developers google group

Reported by dawagner on 2012-04-24 06:10:45

lukeis commented 8 years ago
Duplicated this post in selenium-developers group too.

Reported by jan.c.kester on 2012-04-24 06:19:18

lukeis commented 8 years ago
This proposal may require some debate... (but still good proposal).

* you've already demonstrated this can be done outside of core Selenium, why need to
bundle it as part of project? Rather the community should better publicize the interactive
approach as a complement to the JUnit approach --> done via blog posts, articles, group/conference
presentations, and of course most beneficial is for Selenium developers to post such
code examples on the wiki page (rather than just the JUnit one). Unfortunately, the
community has no comment access and can't append to the wiki page.

* do note that when you bring up this topic on the Java side, one has a choice of options:
Groovy, Beanshell, Jython, JRuby, etc. Which to settle on and why? I'm sure people
will have their own favorites among the list. Or bundle them all?

* this interactive approach is also available natively to Python and Ruby bindings,
though I don't know if anyone really takes advantage of it (rather than write unit
tests in Python and Ruby).

FYI I've blogged about this a while back as well, though I didn't necessarily document
things thoroughly for novice users:

http://autumnator.wordpress.com/2012/02/02/developing-and-debugging-in-java-via-an-interpreter/

http://autumnator.wordpress.com/2011/11/06/using-selenium-with-interactive-interpreter-shells/

Reported by mangaroo on 2012-05-07 20:47:13

lukeis commented 8 years ago
Thanks, I am hoping on a big debate, I think tooling is extreme important.
Apple has shown us, that usability is the key to success, and that details are making
a difference.

My experience is, that most UI automation teams use selenium-junit quite inefficiently.
With a better tooling, efficiency may go up several 100%s. Most UI testers are not
as technical as the committers of selenium tool, and just need something easy to use.

My hope is, that we can change the way of testing. Instead of debugging/analyzing,
then writing tests, then debugging/analyzing, it would be: create your scripts interactively
with trial-error, add asserts to your scripts. You can either run your scripts in still
in manual mode and use it for visual verification, or you run them automatically over
continuous integration.

Some details I find important for tooling:
- must be easy to set up (my maven project runs out of the box, but still maven may
scare off people)
- when in interactive mode, you can both send commands via scripts, or reset browser
state by hand; you can mix, and replay only selected lines
- inside the scripts you can add asserts: this is the basis for real tests
- you can save your scripts
- you can add your own library to the scripts
- you can also run your scripts in automatic mode, and have each run as a test

My example project is doing all this with groovy. I helped a few (ex-) colleagues with
setting up, and so far they are all very enthusiastic ( I hope not out of politeness
:-)). I hope the selenium community can put this topic on the roadmap, and bring out
a really cool, useful tool!

Regards, Jan.

Reported by jan.c.kester on 2012-05-08 20:02:37

lukeis commented 8 years ago

Reported by luke.semerau on 2015-09-17 18:15:17