8000 Is that possible to use screenshotMode: fullpage on ChromeDriver? · Issue #557 · gemini-testing/gemini · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.
This repository was archived by the owner on Sep 21, 2022. It is now read-only.

Is that possible to use screenshotMode: fullpage on ChromeDriver? #557

Open

Description

@thybzi

Trying to use Gemini via ChromeDriver for mobile emulation testing
I want to get full page screenshot

My current settings are the following:

browsers:
  mobile-320:
    desiredCapabilities:
      browserName: chrome
      chromeOptions:
        mobileEmulation:
          userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.3 (KHTML, like Gecko) Version/8.0 Mobile/12A4345d Safari/600.1.4'
          deviceMetrics:
            width: 320
            height: 6000
            pixelRatio: 1

This variant doesn't fail, though makes screenshots not 6000px high, but my available screen area high

I tried adding screenshotMode: fullpage, which doesn't have any effect.

Combining screenshotMode: fullpage with height: 568 (instead of 6000) leads to out of bounds exception.

Any idea how to make this work (and make fullscreen mobile screenshot)?

Activity

  1. thybzi commented on Aug 22, 2016

    @thybzi
    Author

    I am capturing body element (html produces the same error)

    Exception I'm getting:

    StateError: Can not capture the specified region of the viewport.
                The region bottom bound is outside of the viewport height.
                Alternatively, you can test such cases by setting "true" value to option "compositeImage" in the config file.
                Element position: 0, 0; size: 320, 1611.
                Viewport size: 320, 568.
    

    Setting compositeImage: true makes header with position fixed to duplicate on multiple positions, which is not good.

  2. sipayRT commented on Aug 25, 2016

    @sipayRT
    Member

    in your case you can change position: fixed to position: static with executeJS to capture all body. But what state you need to check?

  3. thybzi commented on Aug 25, 2016

    @thybzi
    Author

    I just want to capture the full page without header doubling :)

  4. thybzi commented on Aug 25, 2016

    @thybzi
    Author

    Thanks for executeJS hack

    But the true question is in issue's title:

    Is that possible to use screenshotMode: fullpage on ChromeDriver?

  5. sipayRT commented on Aug 25, 2016

    @sipayRT
    Member

    option screenshotMode is about working with page, it's not mean that you can get screenshot of the full page. To capture block that biggest than viewport sizes you should use compositeImage option

  6. thybzi commented on Aug 28, 2016

    @thybzi
    Author

    UPD. "Out of bounds" exception is thrown even with both screenshotMode: fullpage and compositeImage: true set at the same time, if I use ChromeDriver.

    When using PhantomJS with the same options enabled, no such error is produced.

    Reproduced on Windows 10, but if you want, I'll try to reproduce on MacOSX/Ubuntu systems, too

  7. sipayRT commented on Aug 29, 2016

    @sipayRT
    Member

    "Out of bounds" exception is thrown even with both screenshotMode: fullpage and compositeImage: true set at the same time, if I use ChromeDriver.

    Can you show your screen sizes and Chrome version on which I can reproduce that behavior?

  8. thybzi commented on Sep 8, 2016

    @thybzi
    Author

    Real screen size: 1920×1080
    Gemini config screen size: 320×578 (set via deviceMetrics, or windowSize, or both)
    Chrome version: 52.0.2743.116 m
    ChromeDriver version: 2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129)
    Gemini version: 4.6.0
    Windows version: Windows 10 x64, version 1511, build 10586.545

  9. sipayRT commented on Sep 9, 2016

    @sipayRT
    Member
  10. thybzi commented on Sep 21, 2016

    @thybzi
    Author

    You mean it's fixed in #592?

  11. sipayRT commented on Sep 21, 2016

    @sipayRT
    Member

    it's about out of the bound only. Your case with fixed header can't be fixed by gemini

  12. thybzi commented on Sep 21, 2016

    @thybzi
    Author

    Ok, I'll retest the issue with fresh version of gemini

  13. lo1tuma commented on Oct 6, 2016

    @lo1tuma
    Contributor

    I’ve exactly the same issues as @thybzi described.

    I’m using gemini v4.12.0 and still get the Out of bounds exception. Seems like #592 did not fix this problem. I’ve added some console.log statements here in order to see the actual numbers, here is what I got:

    safeRect.left 0
    safeRect.top 1136
    safeRect.width 320
    safeRect.height -304
    imageSize.height 832
    imageSize.width 1440
    rect.width 320
    rect.height 568
    rect.top 1136
    rect.left 0
    

    As you can see safeRect.height is a negative number which probably causes the problem.

    For my test case I have set screenshotMode to fullpage and compositeImage to true. I haven’t set window sizes explicitly but I’m also using the mobileEmulation feature of chromeDriver with the Apple iPhone 5 preset.

    "desiredCapabilities": {
      "chromeOptions": { "mobileEmulation": { "deviceName": "Apple iPhone 5" } }
    }

    I’m testing against chrome 53.0 on Windows 10 with a native screen resolution of 1440x900 (via saucelabs). I’m capturing the body element.

  14. sipayRT commented on Oct 6, 2016

    @sipayRT
    Member

    @lo1tuma can you provide test and page for testing to reproduce your problem?

  15. lo1tuma commented on Oct 6, 2016

    @lo1tuma
    Contributor

    @sipayRT sure, I pushed a reproducible test case here: https://github.com/lo1tuma/gemini-issue-557

  16. sipayRT commented on Oct 10, 2016

    @sipayRT
    Member

    @eGavr ⬆️ tvoj lubimij "out of the bounds" :)

  17. eGavr commented on Oct 10, 2016

    @eGavr
    Contributor

    @sipayRT , кажется, что для out of the bounds стоит завести отдельный issue, нет?

  18. pftg commented on Nov 8, 2016

    @pftg

    Will be great to fix this and out of the bounds issues. Any updates here?

  19. mchennig commented on Dec 4, 2018

    @mchennig

    Currently having the same Problem with current versions of Chrome, Selenium and Gemini. Maybe this is related to Chromedriver Issue 294?

  20. masi commented on Mar 29, 2019

    @masi

    Having the same issues.

    But actually I'm luvky when I get "out of bounds". I've been experiencing all kinds of issues includung various failures to "inject" (?) Gemini code into th page etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0