webdrivercss icon indicating copy to clipboard operation
webdrivercss copied to clipboard

Extremely slow workflow

Open el3ment opened this issue 10 years ago • 7 comments

If you request multiple screen widths, the workflow is built to resize the screen and take a screenshot for every element rather than take a screenshot at a size, and then pull all of the elements at that size, change the size and pull all of the elements again.

el3ment avatar Nov 19 '14 16:11 el3ment

It usually should only take one screenshot per size per webdrivercss call. Meaning that you should only call webdrivercss once per page! If there are multiple elements per page it reuses the taken screenshots.

christian-bromann avatar Nov 19 '14 16:11 christian-bromann

I thought it was supposed to - but it dosen't seem to be doing that for multiple screen widths

I added a few comments to asyncCallback and makeScreenshot and ran my test again -- this is what it looks like

yep - this.self.takeScreenshot is true
this.screenWidth has stuff
yep - this.self.takeScreenshot is true
this.queuedShots has stuff
this.screenWidth has stuff
yep - this.self.takeScreenshot is true
this.queuedShots has stuff
this.screenWidth has stuff
yep - this.self.takeScreenshot is true
this.queuedShots has stuff
this.screenWidth has stuff
yep - this.self.takeScreenshot is true
this.queuedShots has stuff
this.screenWidth has stuff
yep - this.self.takeScreenshot is true
this.queuedShots has stuff
this.screenWidth has stuff
yep - this.self.takeScreenshot is true
this.queuedShots has stuff
this.screenWidth has stuff
yep - this.self.takeScreenshot is true
this.queuedShots has stuff
this.screenWidth has stuff
yep - this.self.takeScreenshot is true  

el3ment avatar Nov 19 '14 16:11 el3ment

On further research -- I think it's because, on line 24 of asyncCallback.js, it checks to see if there are screenWidths left to test.. and starts the process over -- AFTER thre are no additional widths to test, it jumps to line 33 and shifts a queuedShot and does the process again.

el3ment avatar Nov 19 '14 19:11 el3ment

@el3ment I was able to reproduce that .. Could you check if v1.0.1 fixes it?

christian-bromann avatar Nov 25 '14 12:11 christian-bromann

This does not seem to be fixed in the current version and seems to be the largest perf hit for our screenshot task.

elicwhite avatar Jan 30 '15 08:01 elicwhite

Has anyone been able to work around this? For us, capturing 17 elements over 3 pages at 4 browser widths takes around 11 minutes.

penx avatar May 24 '16 09:05 penx

With the new version we will only stitch screenshot if required (based on browser driver). Also once it is compatible with v4 of WebdriverIO you can run these processes in parallel which should speed up the process overall.

christian-bromann avatar May 24 '16 23:05 christian-bromann