简体   繁体   中英

robot framework with java keywords : Selenium.open(..) opens Firefox browser in hidden mode

I have a Java test automation suite developed with selenium RC. Trying to call Java methods in Robot Framework test suite as keywords.

At times, I see that Selenium.open(..) , though gets executed, Firefox browser (version 38.3) is hidden, and next command can not find the launched Window, though Robot test report says open command is successful.

Same code works fine with Google Chrome.

So how do we unhide the Hidden FF Window:

Code:

Java

public class UILib{
  public void initSelenium(){
    Selenium selenium=new DefaultSelenium(SEL_HOST, SEL_PORT, "chrome", ADMURL);
    //Starting Selenium Instance
    selenium.start();

    //Opening Selenium Browser
    selenium.open(AdminURL);
    Thread.sleep(1000);

  } 
}

Robot Test Suite

*** Settings ***
Library    somepackage.UILib

*** Test Cases ***
Open Login page
     Init Selenium

To maximise your browser window use this:

//Opening Selenium Browser
selenium.open(AdminURL);
selenium.windowMaximize()

您可以使用Robot Framework Builtin命令来最大化浏览器。

Maximize Browser Window

I could not get to the root cause of this issue yet. Though I could make it work by upgrading FF version to 38.5.1 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM