robotframework / OldSeleniumLibrary

Deprecated Selenium library for Robot Framework
Apache License 2.0
13 stars 3 forks source link

Patch for /src/SeleniumLibrary/screenshot.py #262

Closed spooning closed 9 years ago

spooning commented 9 years ago

Originally submitted to Google Code by jollych... on 17 Jul 2013

screenshot file name append hash, for selenium grid2 runner report

spooning commented 9 years ago

Originally submitted to Google Code by jollych... on 25 Jul 2013

anybody can merge it?thanks

spooning commented 9 years ago

Originally submitted to Google Code by @jussimalinen on 13 Aug 2015

We are moving Selenium Library to github and creating a last release with Robot 2.9 support before stopping the support of this project entirely.

We will look at merging the patch before creating the last release.

pekkaklarck commented 9 years ago

Attachment cannot be copied from Google Code so here's the proposed patch:

--- a/src/SeleniumLibrary/screenshot.py
+++ b/src/SeleniumLibrary/screenshot.py
@@ -80,6 +80,8 @@
             filename = self._namegen.next()
         else:
             filename = filename.replace('/', os.sep)
+        import os
+        filename = filename.replace('.png', '%s.png' % os.urandom(16).encode('hex'))
         logdir = self._get_log_dir()
         path = os.path.join(logdir, filename)
         link = utils.get_link_path(path, logdir)
pekkaklarck commented 9 years ago

We decided not to do the proposed change because it would change behavior in backwards incompatible manner. It could be considered in a major version, but because this library is deprecated we are not planning to release new major versions.