简体   繁体   English

如何使用Java使用氦气最大化浏览器窗口?

[英]How to maximize browser window with helium using Java?

I am trying to implement helium in my project, I checked the API doc of helium but I didn't find any commend to maximize the browser.我正在尝试在我的项目中实现 helium,我检查了 helium 的 API 文档,但我没有找到任何可以最大化浏览器的建议。

In the API doc I found solution to launch the browser.在 API 文档中,我找到了启动浏览器的解决方案。 Code is as following代码如下

startFirefox();
startFirefox("google.com");

So I would appreciate if any one can help me with this.因此,如果有人能帮助我解决这个问题,我将不胜感激。 Is it possible to integrate Selenium and helium all together?是否可以将硒和氦整合在一起?

You can use Selenium WebDriver by integrating with Helium.您可以通过与 Helium 集成来使用 Selenium WebDriver。 The following code would work fine:以下代码可以正常工作:

import static com.heliumhq.API.*;
import org.openqa.selenium.*;

startFirefox("http://www.google.com");//This is the Helium code
getDriver().manage().window().maximize();//getDriver is Helium method and other portion is WebDriver code

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

相关问题 如何在Java中使用Sahi来最大化浏览器 - How to maximize browser using Sahi with java Selenium Grid:如何使用RemoteWebDriver和ChromeDriver最大化浏览器窗口 - Selenium Grid: how to maximize browser window using RemoteWebDriver and ChromeDriver Java窗口事件-最大化。 如何进行硬编码? - Java Window Event - Maximize. How to hardcode? 如何使用氦气从页面读取文本? - How to read a text from a page using Helium? 如何在 Java 中隐藏 JFrame 窗口上的默认最小化/最大化和关闭按钮? - How to hide the default minimize/maximize and close buttons on JFrame window in Java? 带有最大化按钮的Java模态窗口 - Java modal window with maximize button 使用Netbeans自动最大化窗口 - Automatically Maximize Window Using Netbeans 如何在 selenium 2 WebDriver 中找到当前使用窗口是最大化还是最小化? - How to find the whether the current using window is maximize or minimize in selenium 2 WebDriver? 在Selenium中使用命令“ driver.manage()。window()。setPosition(new Point(0,-1000));”之后,无法最大化浏览器 - Not able to maximize browser after using the command “driver.manage().window().setPosition(new Point(0,-1000));” in Selenium 如何使用Java关闭Selenium WebDriver中的子浏览器窗口 - How to close child browser window in Selenium WebDriver using Java
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM