Parser problem with Seam Test - maven-2

I have a maven project in Eclipse, a web-project using Seam. Now I wanted to use Seam Test for unit test. I dit not use SeamGen to create the project.
I followed this guide, but when I run my test I get this error. I get a feeling the wrong sax parser is being used. Does anyone recognize it?
[Parser] Running: :\Documents and Settings\PEJA715\Local Settings\Temp\testng-eclipse\testng-customsuite.xml
FAILED CONFIGURATION: #BeforeSuite startSeam
java.lang.RuntimeException: Unable to bootstrap:
at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:147)
at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:183)
at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:195)
at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11)
at org.jboss.seam.mock.AbstractSeamTest.startJbossEmbeddedIfNecessary(AbstractSeamTest.java:1024)
at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:915)
at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58)
Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser
at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:100)
at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:85)
at org.jboss.embedded.Bootstrap.deployBaseBootstrapUrl(Bootstrap.java:130)
at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:142)
... 21 more
Caused by: org.jboss.xb.binding.JBossXBException: Failed to create a new SAX parser
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.(SaxJBossXBParser.java:97)
at org.jboss.xb.binding.UnmarshallerImpl.(UnmarshallerImpl.java:55)
at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:96)
... 24 more
Caused by: javax.xml.parsers.ParserConfigurationException: Feature 'http://apache.org/xml/features/xinclude' is not recognized.
at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.(SaxJBossXBParser.java:92)
... 26 more
... Removed 15 stack frames
SKIPPED CONFIGURATION: #BeforeClass setupClass
SKIPPED CONFIGURATION: #BeforeMethod begin
SKIPPED CONFIGURATION: #AfterMethod end
SKIPPED CONFIGURATION: #AfterClass cleanupClass
SKIPPED: testRegister
===============================================
TestOfTest
Tests run: 1, Failures: 0, Skips: 1
Configuration Failures: 1, Skips: 4
===============================================
===============================================
effsort-web
Total tests run: 1, Failures: 0, Skips: 1
Configuration Failures: 1, Skips: 5
===============================================
[org.testng.internal.PoolService] Shutting down poolservice org.testng.internal.PoolService#1117a20 terminated:false

Hard to say from the stacktrace (showing your dependencies might help) but double check that you use the SAX parser used by JBoss 5.0.1.GA (and not xml-apis that you might get transitively).

Related

Jenkins:java.lang.IllegalStateException: The driver executable does not exist:/src/***/Chrome_Drivers/chromedriver_win32/chromedriver.exe

Exception while taking screenshot Cannot invoke method getScreenshotAs() on null object
Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 0.907 sec <<< FAILURE! -
java.lang.IllegalStateException: The driver executable does not exist:/src/***/Chrome_Drivers/chromedriver_win32/chromedriver.exe
While running the selenium jobs in Jenkins, how should we specify the chrome driver path?
I am trying to run the code in windows and the same code is running fine in my local however when I try to run the same code with Jenkins(code in bitbucket) it does not find the path.
I tried adding bitbucket URL in the System.setProperty("webdriver.chrome.driver", "https://bitbucket.org///src/***/config/chromedriver.exe");
but nothing works.
Please help.

How can I mark skipped test case as fail in TestNG?

I am using sbt test to run TestNG test cases:
I get a testing result like this
===============================================
xxxx-test
Total tests run: 2, Failures: 0, Skips: 2
Configuration Failures: 1, Skips: 1
===============================================
[info] Passed: Total 2, Failed 0, Errors 0, Passed 0, Skipped 2
[success] Total time: 8 s, completed May 11, 2019 11:44:59 AM
The configuration failure is caused by an error in #BeforeClass phase.
The problem is my CI treat this result as passed.
How can I mark the whole test failed if any of my test cases skipped?
How about trying to modify the test result to fail via IMethodListener or ITestListener?

How to migrate from cucumber-jvm to QAF using testNG?

This post is in addition query to Is it possible to migrate from cucumber-jvm to QAF? Could you please help me know the approach to execute as testNG? For now I've configured the example from below link
https://github.com/qmetry/qaf/releases/download/2.1.9-RC2/QAFGherkin.zip
however when I try to execute the CucumberRunner.java It doesn't find any feature
log4j:WARN No such property [follow] in org.apache.log4j.FileAppender.
[ConfigurationManager] - ISFW build info: {qaf-Type=core, qaf-Revision=9-RC1, qaf-Version=2.1, qaf-Build-Time=23-Sep-2016 12:16:17}
[ConfigurationManager] - Resource dir: C:\Users\Kalyankar\Downloads\qaf-blank-project-maven-masterDec\qaf-blank-project-maven-master\resources. Found property files to load: 6
[ConfigurationManager] - Resource dir: C:\Users\Kalyankar\Downloads\qaf-blank-project-maven-masterDec\qaf-blank-project-maven-master\resources. Found property files to load: 0
[TestNG] Running:
C:\Users\Kalyankar\AppData\Local\Temp\testng-eclipse-1055468291\testng-customsuite.xml
No features found at [classpath:com/qmetry/qaf/examples/cucumber/runners]
0 Scenarios
0 Steps
0m0.000s
PASSED: run_cukes
Runs Cucumber Features
===============================================
Default test
Tests run: 1, Failures: 0, Skips: 0
===============================================
===============================================
Default suite
Total tests run: 1, Failures: 0, Skips: 0
===============================================
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter#6e1567f1: 18 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2#72d818d1: 18 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 30 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter#31a5c39e: 35 ms
[TestNG] Time taken by org.testng.reporters.jq.Main#59ec2012: 224 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter#42dafa95: 131 ms
I've ensured that application.properties values are also set as step.provider.pkg=com.qmetry.qaf.examples.steps.cucumber then later, I moved a feature file to com.qmetry.qaf.examples.cucumber.runners package & executed it. No luck. Any help would be much appreciated.
Thanks in advance
Please refer migration steps. Will you please share your project structure after migration and config file you are using?
Use QAF latest version and don't run with cucumber runner, instead run using QAF. Below is sample configuration file:
<test name="Gherkin-QAF-Test">
<parameter name="step.provider.pkg" value="your.steps.pkg" />
<parameter name="scenario.file.loc" value="your features file relative path" />
<classes>
<class name="com.qmetry.qaf.automation.step.client.gherkin.GherkinScenarioFactory" />
</classes>
</test>
You can run as TestNG test.
Default directory for .bdd or .feature file is <project_home>/scenarios directory. If it is not under /scenarios you need to set using scenario.file.loc.

Can get Play 2.2 details when running JUnit testing with Play 2.3

I'm having issue with play framework and JUnit test with play 2.3
When running: "activator test" then it runs fine, but...
[info] Loading project definition from /.../test/toto/project
[info] Set current project to toto (in build file:/home/jenkins/.../)
[info] Compiling 6 Java sources to /home/jenkins/automated_tests/.../toto/target/scala-2.11/test-classes...
[warn] application - do execute tests in class utils.UtilsTest
[warn] application - do execute tests in class test_marketcity.BasicTest
[info] Passed: Total 14, Failed 0, Errors 0, Passed 14
[success] Total time: 29 s, completed Feb 12, 2015 9:48:51 AM
There's nothing about the test which have been run, only the full total of test (14 here). With play 2.2 I had a more detailled log containing also each test:
[info] x firstTest (x means here it failed)
[info] + secondTest (+ means here it succeeded)
Should I have to put a specific option here to get more details ?
Thx
It is a common issue with tests on activator. I usually run activator clean before tests to get the output. Sometimes running tests from sbt helps.

reports in junit selenium webdriver

I use selenium web driver with junit in Eclipse. Advice me please how can I report test results?
I try make it in such way:
http://testerinyou.blogspot.com/2011/03/how-to-create-reports-using-junit.html?showComment=1342535781861#c6211334222001490686
But get errors during gereration:
Buildfile: E:\eclipse\WebDriver\build.xml
build-subprojects:
init:
build-project:
[echo] WebDriver: E:\eclipse\WebDriver\build.xml
[javac] E:\eclipse\WebDriver\build.xml:43: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
build:
Sector:
[mkdir] Created dir: E:\eclipse\WebDriver\junit
[junit] Running Sector
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
[junit] Test Sector FAILED
junitreport:
[junitreport] Processing E:\eclipse\WebDriver\junit\TESTS-TestSuites.xml to E:\DOCUME~1\CONSUL~1\LOCALS~1\Temp\null255203125
[junitreport] Loading stylesheet jar:file:/E:/eclipse/plugins/org.apache.ant_1.8.2.v20120109-1030/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs /optional/junit/xsl/junit-frames.xsl
[junitreport] : Error! The first argument to the non-static Java function 'replace' is not a valid object reference.
[junitreport] : Error! Cannot convert data-type 'void' to 'reference'.
[junitreport] : Fatal Error! Could not compile stylesheet
[junitreport] Failed to process E:\eclipse\WebDriver\junit\TESTS-TestSuites.xml
BUILD FAILED
E:\eclipse\WebDriver\build.xml:135: Errors while applying transformations: Fatal error during transformation
Total time: 4 seconds
There are different possibilities to create reports for Selenium WebDriver.
A user developed a small library to create a html report with screenshots and so on.
For further information look here: https://github.com/vorburger/webdriver-reporting
Furthermore you could use another framework based on Selenium called Thucydides. It generates really nice looking html-reports and improves Selenium WebDriver. You can visit the official website for more information (www.thucydides.info)
You could use Ant oder TestNG to create a report for your tests.
Look here for more information: http://selftechy.com/2011/06/29/selenium-use-ant-to-generate-html-reports
I like UnitTH to generate test reports.
You can start it via ant or maven
Further questions?