Skip to content

Fix PrintOptions size example to replace setScale with setPageSize for A4 dimensions #2118

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

Merged
merged 2 commits into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.junit.jupiter.api.Test;
import org.openqa.selenium.print.PageMargin;
import org.openqa.selenium.print.PrintOptions;

import org.openqa.selenium.print.PageSize;
import dev.selenium.BaseChromeTest;

public class PrintOptionsTest extends BaseChromeTest {
Expand Down Expand Up @@ -31,8 +31,8 @@ public void TestSize()
{
driver.get("https://www.selenium.dev/");
PrintOptions printOptions = new PrintOptions();
printOptions.setScale(.50);
double current_scale = printOptions.getScale();
printOptions.setPageSize(new PageSize(27.94, 21.59)); // A4 size in cm
double currentHeight = printOptions.getPageSize().getHeight(); // use getWidth() to retrieve width
}

@Test
Expand Down
Loading