[
https://issues.apache.org/jira/browse/MPOM-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16562194#comment-16562194
]
Jagan commented on MPOM-204:
----------------------------
This is simple Selenium script I written using headless browser
package selenium.headlessbrowsertest;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.testng.annotations.Test;
public class HBrowserMavenSeleniumtest {
@Test
public void testUrl() throws InterruptedException {
HtmlUnitDriver driver=new HtmlUnitDriver();
//WebDriver driver=new FirefoxDriver();
driver.get("https://mvnrepository.com/");
Thread.sleep(8000);
System.out.println(driver.getTitle());
Thread.sleep(2000);
}
}
> Getting INSTANCE error while running maven build using POM
> ----------------------------------------------------------
>
> Key: MPOM-204
> URL: https://issues.apache.org/jira/browse/MPOM-204
> Project: Maven POMs
> Issue Type: Test
> Components: maven
> Reporter: Jagan
> Priority: Major
> Labels: test
> Attachments: POM_Mavendependencies.docx
>
>
> Hi all, I created Maven project and and added Headless browser selenium
> script.
> I created testNG suit for that script.
> Also added required plugins and dependencies in POM.xml file.
> But while running as maven build getting below error
> {noformat}
> [RemoteTestNG] detected TestNG version 6.9.9
> [TestNG] Running:
> C:\Users\IBM_ADMIN\git\JaganMavenPL\src\selenium\resources\testng.xml
> Exception in thread "Thread-1" java.lang.NoSuchFieldError: INSTANCE
> at
> org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:146)
> at
> com.gargoylesoftware.htmlunit.HttpWebConnection.configureHttpsScheme(HttpWebConnection.java:625)
> at
> com.gargoylesoftware.htmlunit.HttpWebConnection.createHttpClient(HttpWebConnection.java:557)
> at
> com.gargoylesoftware.htmlunit.HttpWebConnection.getHttpClientBuilder(HttpWebConnection.java:518)
> at
> com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:170)
> at
> com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1397)
> at
> com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1315)
> at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:394)
> at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:315)
> at
> org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:683)
> at
> org.openqa.selenium.htmlunit.HtmlUnitDriver.lambda$get$8(HtmlUnitDriver.java:670)
> at
> org.openqa.selenium.htmlunit.HtmlUnitDriver.lambda$runAsync$0(HtmlUnitDriver.java:424)
> at java.lang.Thread.run(Thread.java:748)
> {noformat}
> Could any one help on this how to resolve.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)