简体   繁体   English

如何将 chrome 浏览器缩放到 67% 并单击下一步按钮。?

[英]How to zoom the chrome Browser to 67% and click on the next button.?

Kindly help me to know about the correct code in Selenium where i can set the 67% zoom in chrome browser and then click on the next button.!请帮助我了解 Selenium 中的正确代码,我可以在 chrome 浏览器中设置 67% 缩放,然后单击下一步按钮。!

Use below sample code使用下面的示例代码

WebDriver driver = new ChromeDriver();
driver.get("https://google.com");
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("document.body.style.zoom = '0.67'");  // 67% Zoom

System.out.println("67% zoom done");

Thread.sleep(5000);

executor.executeScript("document.body.style.zoom = '1.00'"); // 100% Zoom

System.out.println("100% zoom done");

As stated in comment 0.67 means 67% , 1.00 means 100% zoom and so on如评论中所述0.67表示67%1.00表示100%缩放等等

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在我的android项目中,有两个类,并且在第一类上有一个按钮,当我单击按钮时,我需要查看下一页。 - In my android project there are two classes and there is a button on first class,i need to view next page when i click on the button. 单击按钮更改图标。 爪哇 - Change icon with click on button. Java 如何为按钮中的字母创建缩进。 JavaFX - How create Indent for letters in button. JavaFX 使用Android Chrome浏览器在文本字段中输入后单击按钮 - Click a button after typing in the text fields, using the Android Chrome browser 如何在Java代码中实现下一步按钮单击? - How to implement a next button click in Java code? 如何使音乐在下一个按钮单击时停止 - How to get music to stop on next button click 如何在单击按钮时将图像发送到下一个屏幕 - how to send a image to next screen on button click 如何触发点击 chrome 扩展按钮? - How to trigger a click on a chrome extension button? 如何使用javascript记录链接点击然后自动点击Qualtrics中的下一个按钮? - How to record a link click and then automatically click next button in Qualtrics with javascript? 我在一个按钮上有 LinearLayout。 有没有办法处理按钮点击事件? - I have LinearLayout over a button. Is there any way to handle underneath button click event?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM