splinter icon indicating copy to clipboard operation
splinter copied to clipboard

Using browser.screenshot(name = '/var/aa', suffer = '.jpg') filename turn out to 'aaxiHXq8.jpg'

Open cillyfly opened this issue 11 years ago • 4 comments

Using browser.screenshot(name = '/var/aa', suffer = '.jpg') filename turn out to 'aaxiHXq8.jpg' I don't know why? need some help

cillyfly avatar Oct 30 '15 10:10 cillyfly

IIUC the string xiHXq8 is a randomly generated string which gets appended to the filename aa you provide in browser.screenshot(name, suffer). I assume this is done to avoid to replace an already existing file with the same name. Just a guess.

markuszoeller avatar Aug 23 '16 17:08 markuszoeller

@andrewsmedina browser.screenshot uses tempfile.mkstemp to get a filename with a random portion to the filename. Is this the desired behaviour? In the event of the provided filename already existing, should we write a new file (current behaviour, due to random string) or throw an exception? Either way, overwriting the existing screenshot is definitely something to avoid.

javascript-error avatar Jan 07 '20 21:01 javascript-error

This is very confused. Can you add a switch to use my real filename or add random postfix?

phaibin avatar Apr 29 '20 08:04 phaibin

Fixed by #949

javascript-error avatar Dec 01 '21 02:12 javascript-error