Closed cgaulay closed 6 years ago
Hello! It seems like you misunderstand option screenshotDelay
. Your page has some elements, that appear with time, so you want to wait for them to appear before taking a screenshot. You have 2 common ways to achieve that:
actions.waitForElementToShow(selector, [timeout])
function in your capture
block if you are waiting for some particular elementactions.wait(milliseconds)
if there are many delayed elements
Read more hereIn you case I think you want to do something like this:
gemini.suite('test', (suite) => {
suite.setUrl('/')
.setCaptureElements('body')
.capture('plain', (actions) => actions.wait(2000));
});
and remove screenshotDelay
option.
This should fix your problem. Please report if it does and close issue.
P.S.
About screenshotDelay
. For example your body
can be captured by 4 screenshots. So if you use screenshotDelay: 2000
then whole capture session will last for ≈8 seconds. But if you use actions.wait(2000)
, capture session will wait for 2 seconds and then perform 4 screenshots with no interval, so session will last ≈2 seconds
@cgaulay There are some errors in your config. Instead of this:
browsers:
firefox:
desiredCapabilities:
screenshotMode: fullpage
browserName: firefox
compositeImage: true
you should write something like this:
browsers:
firefox:
screenshotMode: fullpage
compositeImage: true
desiredCapabilities:
browserName: firefox
screenshotMode
and compositeImage
are the browser options and not the desired capabilities. In fact you can omit screenshotMode
option, it does nothing in your case.
Hi all,
thanks a lot for your answers.
@Dmitriy-kiselyov, i've tried to add some wait options but it doesn't work much more.
@j0tunn, i've fixed my config and i've the same result :(
Any other ideas ?
Thanks. Regards,
Hello! Can you please provide minimal-case html page with same error? And I will try to send you a config file and gemini test, which covers it. Or fix bugs if it is gemini's fault.
Hi @Dmitriy-kiselyov, thanks for your answser. I've tried to execute my test on another html page with the same configuration file. And it doesn't work much more but i've an error : "Out of the bound" (with chrome and firefox). However, during the test, Gemini seems to scroll on the page.This is not the same behavior than my html page.
But, to answser your question, you can try to take fullpage screenshot on this url : www.ouest-france.fr
Thanks in advance, Regards
Hey @Dmitriy-kiselyov , I've got the same issue in Chrome browser (Version 65.0.3325.146). I'd like to capture fullpage screenshot but it captures viewport only. Here is a minimal-case example https://github.com/generalov/gemini-demo .
@cgaulay & @generalov try to set the viewport as following, and it should work:
screenshotMode: 'viewport',
I don't know why need to set viewport and the full page captured. Wired why set fullpage not working...
For more, please refer to: Gemini_Chrome_SimulatePC&iPhone
Hi @Kenith,
it's doesn't work. When i set the screenshotMode with "viewport" it capture viewport only .. Thanks
@cgaulay I am trying your script now. And will get back to you asap
@cgaulay I don't change much, just make mainly move the compositeImage: true
to the top.
And it works!!
Please get all the data here: Gemini.zip
And I used the docker: https://github.com/Kenith/ta-visual-lib for testing.
Hi @Kenith,
I've found a root cause of my issue. It is CSS rule html, body { height: 100%; }
. So the both .setCaptureElements('html')
and .setCaptureElements('body')
brings to small capture area. The area is equal to size of viewport rather to size of document. Surprise! :) Unfortunately, the same CSS rule is at yandex.ru home page.
I added a tweak into before
and got a screenshot of whole page.
before((actions) => {
actions.executeJS(function() { document.documentElement.style.height = 'auto'; })
})
@generalov Glad to hear that it is working! ;)
Hi all,
it works for me with the tweak and compositeImage: true.
Thanks @Kenith, @generalov and all others !
Hi,
is there any way to capture the full page with gemini ? i've tried to do this but it doesn't work fine for me. There is just the viewport screen. thanks in advance. Regards,
Output of
gemini --version
: 5.6.2Contents of
.gemini.yml
file:Test source code:
Command used to run the test:
Result: There is just the viewport screen