Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen captured by shutterbug is not correct #12

Closed
vishruth143 opened this issue Oct 12, 2016 · 9 comments
Closed

Screen captured by shutterbug is not correct #12

vishruth143 opened this issue Oct 12, 2016 · 9 comments
Assignees
Projects

Comments

@vishruth143
Copy link

vishruth143 commented Oct 12, 2016

Hi @glib-briia,

My apologies for raising this bug again and again.
I have written the below code. But the output screen captured by shutter bug is not correct. I double checked all my xpaths and its correctly recognizing the web elements. Am I doing something wrong here.

import java.awt.Color;
import java.awt.Font;
import java.util.Date;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

import com.assertthat.selenium_shutterbug.core.Shutterbug;

public class ShutterBug {

    public static void main(String[] args) {
//      System.setProperty("webdriver.chrome.driver", "C:\\Eclipse\\Drivers\\chromedriver.exe");
//      WebDriver driver = new ChromeDriver();
        System.setProperty("webdriver.gecko.driver","C:\\Eclipse\\Drivers\\geckodriver.exe");
        WebDriver driver = new FirefoxDriver();
        driver.manage().window().maximize();
        driver.get("https://www.google.com/");
        WebElement googleLogo = driver.findElement(By.xpath(".//*[@id='hplogo']"));
        WebElement searchBtn = driver.findElement(By.xpath(".//*[@id='tsf']/div[2]/div[3]/center/input[1]"));
        WebElement searchBox = driver.findElement(By.xpath(".//*[@id='lst-ib']"));

        //searchBox.sendKeys("Testing");    

        Shutterbug.shootPage(driver)
            .blur(searchBox)
            .highlight(searchBtn)
            .monochrome(googleLogo)
            .highlightWithText(googleLogo, Color.blue, 3, "Monochromed logo",Color.blue, new Font("SansSerif", Font.BOLD, 20))
            .highlightWithText(searchBox, "Blurred secret words")
            .withTitle("Google home page - " + new Date())
            .withName("home_page")
            .withThumbnail(0.7)
            .save("C:\\Users\\Vishvambruth JT\\Desktop\\Screen.jpg");
            driver.quit();      
    }
}

I'm Using:
Firefox Version: 49.0.1
Chrome Version: 54.0.2840.59 m
Selenium Version: Version 3.0.0
OS: Win10 64 bit
Java: 1.8

Output Screen captured by shutterbug

home_page

@glibas
Copy link
Member

glibas commented Oct 14, 2016

Hi @vishruth143 ,

I cant reproduce the issue you are having. Tried executing your code with the same set up.
Works as expected.

home_page

Are you still seeing this issue?

@vishruth143
Copy link
Author

vishruth143 commented Oct 15, 2016

Hi @glib-briia ,

With Selenium 3.0.0 and Mozilla Firefox browser I'm able to get the correct screen shot as below.

home_page

But when I run the same code in Chrome, I'm not getting the desired screenshot.

home_page

I'm Using:
Firefox Version: 49.0.1
Chrome Version: 54.0.2840.59 m
Selenium Version: 3.0.0
OS: Win10 64 bit
Java: 1.8

@glibas
Copy link
Member

glibas commented Oct 16, 2016

Hi @vishruth143,

Thank you for update! Which chromedriver version are you using?

@vishruth143
Copy link
Author

Hi @glib-briia,

I'm using chrome driver version 2.24.

@vishruth143
Copy link
Author

vishruth143 commented Nov 20, 2016

Hi @glib-briia ,

I tried this issue again with the below setup. Still I'm facing the same issue i.e.
When I run the above code with Mozilla Firefox browser I get correct screen shot.
But when I run the above code with Chrome browser I get in-correct screen shot.

Do you have any update on this issue? Thank you.

I'm Using:
Firefox Version: 50.0
Chrome Version: 54.0.2840.99 m
ChromeDriver Version: 2.25
Selenium Version: 3.0.1
OS: Win10 64 bit
Java: 1.8

Mozilla Screenshot:
home_page

Chrome Screenshot:
home_page

@glibas glibas assigned glibas and unassigned vishruth143 Nov 20, 2016
@glibas glibas added wontfix and removed question labels Apr 21, 2017
@glibas
Copy link
Member

glibas commented Apr 21, 2017

Unable to reproduce. Closing as wontfix

@glibas glibas closed this as completed Apr 21, 2017
@glibas glibas moved this from In Progress to Done in Shutterbug Apr 28, 2017
@dzaiats
Copy link

dzaiats commented Dec 4, 2017

Hi there! I'm a creator of Automotion framework.
The problem described above is the scaling factor of the screen. Retina vs no retina.
We had the same in Automotion but it's fixed by introducing the manual configuration for the scaling factor.

@glibas
Copy link
Member

glibas commented Dec 4, 2017

Thank you @dzaiats.

@vishruth143 , have you tried using the following:

Shutterbug.shootPage(driver, ScrollStrategy.BOTH_DIRECTIONS,500,true).save();

true in the arguments list stand for devicePixelRatio on retina displays.
Thanks,
Glib

@glibas glibas reopened this Dec 4, 2017
@glibas
Copy link
Member

glibas commented Jul 18, 2018

Closing due to inactivity

@glibas glibas closed this as completed Jul 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Shutterbug
  
Done
Development

No branches or pull requests

3 participants