Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98783

Poor image quality when uploading same image with selenium using java

$
0
0

I am getting bad image quality when I upload image using selenium with java.

Here is a code:

imagePair.setFileLocation(downloadImage1(imagePair.getUrl()));
webElement.sendKeys(imagePair.getFileLocation());
driver.findElement(By.name("button1")).click()

Image pair is just a pojo that holds information what URL should be image downloaded from and where that image is stored after download (filesystem). Downloaded image quality is as good as it should be.

After click is executed image is uploaded.

Did anyone else had the same issue?

This is my configuration of driver:

    WebDriverManager.chromedriver().version("79.0.3945.36").setup();

    ChromeOptions chromeOptions = new ChromeOptions();
    chromeOptions.addArguments("--no-sandbox");

    WebDriver driver = new ChromeDriver(chromeOptions);
    try {
        test(driver);
    } catch (Exception e) {
        log.error(e.getLocalizedMessage(), e);
    }
    driver.close();

If I do the same steps manually then quality of the image is as good as it should be.

Any help would be much appreciated.


Viewing all articles
Browse latest Browse all 98783

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>