1

We have developed selenium scripts to launch the fire fox browser using web driver manager and the code snippet is as follows:

if (m_browserName.equalsIgnoreCase("Fire Fox") || m_browserName.equalsIgnoreCase("Mozilla Fire Fox")) {

    WebDriverManager.firefoxdriver().setup();
    WebDriver m_driver = new FirefoxDriver();
    m_wait = new WebDriverWait(m_driver, cIMPLICITLY_WAIT);
    m_mainWindow = m_driver.getWindowHandle();
    m_driver.manage().window().maximize();
    m_driver.get(baseURL);
    m_driver.manage().timeouts().pageLoadTimeout(cPAGELOAD_TIMEOUT, TimeUnit.SECONDS);
    m_driver.manage().timeouts().implicitlyWait(cPAGELOAD_TIMEOUT, TimeUnit.SECONDS);

    while (!waitForPageToLoad(cPAGELOADTIME));
}

And our observation is that the firefox browser successfully launches while executing the scripts within Eclipse IDE environment. But when we convert this scripts into runnable jar and launch it from the command prompt, the fire fox browser is not launched and we are seeing the below error messages:


WARNING: An illegal reflective access operation has occurred

WARNING: Illegal reflective access by http://org.dom4j.io.SAXContentHandler (file:/C:/Users/test/Desktop/DCalTP1001/DosingCalTP1001.jar) to method http://com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser$LocatorProxy.getEncoding()

WARNING: Please consider reporting this to the maintainers of http://org.dom4j.io.SAXContentHandler

WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations

WARNING: All illegal access operations will be denied in a future release

========== NEW TEST STARTED ==========

20210217_152935 : { LandingDosingCalc }

Browser Setting in Excel Sheet is : Fire Fox

20210217_152939 : Mozilla Fire Fox Browser Selected

SLF4J: This version of SLF4J requires log4j version 1.2.12 or later. See also SLF4J Error Codes

log4j:WARN No appenders could be found for logger (io.github.bonigarcia.wdm.cache.ResolutionCache).

log4j:WARN Please initialize the log4j system properly.

20210217_152942 : { LandingXXXXCalc }

========= TEST FAILED ==========

========== NEW TEST STARTED ==========

20210217_152942 : { UserXXXXPage }

20210217_152942 : { UserXXXXPage }

========== TEST SKIPPED ==========

Can you help us to resolve this issue? Are we missing anything while initializing the fire fox driver through web driver manager (or) any settings to be made in the fire fox browser? Please help.

Ömer Erden
  • 7,680
  • 5
  • 36
  • 45

0 Answers0