selenium rc with cruise control - testng error message - could not instantiate 'test' - selenium-rc

I'm currently trying to set up cruisecontrol to run my selenium test suite. Everything works fine until I run the build, I got the following message:
calling target(s) [execute-test] in build file C:\Project\src\build.xml
Entering C:\Project\src\build.xml...
Exiting C:\Project\src\build.xml.
task location="C:\Project\src\build.xml:30: " name="antcall" time="0 seconds"
target name="execute-test" time="0 seconds"
task location="C:\Project\src\build.xml:37: " name="testng" time="0 seconds"
Executing 'C:\Program Files (x86)\Java\jdk1.6.0_06\jre\bin\java.exe' with arguments:
'-ea'
'-classpath'
'C:\testng;C:\testng\testng-5.9-jdk15.jar;C:\testng\commons-lang-2.0.jar;C:\testng\testng-5.9-jdk14.jar'
'org.testng.TestNG'
'#C:\DOCUME~1\SERVER~1\LOCALS~1\Temp\1\testng10509'
The ' characters around the executable and arguments are
not part of the command.
[Parser] Running:
C:\Project\src\TestSuite.xml
[TestRunner] Running the tests in 'testInpagePlacement' with parallel mode:false
[RunInfo] Adding method selector: org.testng.internal.XmlMethodSelector#9664a1 priority: 10
[ClassHelper] Could not instantiate testcase1: testcase1
[ClassHelper] Could not instantiate testcase1: testcase1
===============================================
[Smoke test]
[Total tests run: 0, Failures: 0, Skips: 0]
===============================================
[org.testng.TestNGException:]
[Cannot find class in classpath: testcase1]
at org.testng.xml.XmlClass.getSupportClass(XmlClass.java:55)
at org.testng.internal.Utils.xmlClassesToClasses(Utils.java:79)
at org.testng.TestRunner.initMethods(TestRunner.java:289)
at org.testng.TestRunner.init(TestRunner.java:235)
at org.testng.TestRunner.init(TestRunner.java:197)
at org.testng.TestRunner.(TestRunner.java:141)
at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:488)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:250)
at org.testng.SuiteRunner.run(SuiteRunner.java:204)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
at org.testng.TestNG.run(TestNG.java:751)
at org.testng.TestNG.privateMain(TestNG.java:914)
at org.testng.TestNG.main(TestNG.java:887)
The tests failed.
This was run on a network server, I'd tested the testsuite.xml locally through intellij and everything works fine. I feel like this is a config issue with the network server, please let me know if my assumption is wrong and point me to the right direction to fix this issue.
Thanks.

You don't have your classes (tests & target classes) on the classpath.

Related

An uncaught error was detected outside of a test

When I run all my component cypress tests locally on a Macbook pro on a react-vite project with around ~10 tests, I get the following error:
An uncaught error was detected outside of a test:
TypeError: The following error originated from your test code, not from Cypress.
> Failed to fetch dynamically imported module: http://localhost:5173/__cypress/src/cypress/support/component.ts
When Cypress detects uncaught errors originating from your test code it will automatically fail the current test.
Cypress could not associate this error to any specific test.
We dynamically generated a new test to display this failure.
the error is not Consistant and doesn't show up on every run. It also throws on a random test every run. How can I solve this?
update: I think a possible lead could be that I import files on my project with the absolute paths pattern.
For example:
import {comp1, comp2} from 'components'
where as components is configured in my tsconfig.ts file
ok so after countless attempts to fix this and also encountering terminal freezes when I execute
cypress run.
I've gave up and created a bash script to run each of the tests in the code base separately:
set -x
#!/bin/bash
for file in $( find . -type f -name '*.spec.cy.tsx' );
do yarn cypress run --component --browser chrome --spec $file || exit 1
done
for now it seems to get the job done. Hope this helps anyone else that encounters this

Failed test in protractor stops the execution for rest test cases

I am running the protractor Suite (spec file having multiple test cases), If any test case fails, protractor does not continue with the next test case execution and all the rest of test cases also fail.
EXPECTED BEHAVIOR:
Upon failure on any test case, protractor should continue with next test case execution.
I used "Protractor-Fail-Fast" Npm package to stop the rest test case execution if any test case fail. But ideally I am not looking for the same.
But this will not help me!
Just for reference: In Visual Studio MS test, If I created ordered test (same as Spec file in protractor having multiple test cases) and then set test setting like "continue on failure", ordered test execution will continue even if some test case failed.
I am looking for a similar test setting or any solution for protractor.
If you dont't want to stop all tests run just stop using Protractor-Fail-Fast library? Protractor tests run till the end by default even if some of the tests are failed.
set ignoreUncaughtExceptions: true in config file as following:
/**
* If set, Protractor will ignore uncaught exceptions instead of exiting
* without an error code. The exceptions will still be logged as warnings.
*/
ignoreUncaughtExceptions?: boolean;
you can get above description from here
export.config = {
...
ignoreUncaughtExceptions: true
}

Single quote in double quote test name of Spock test leads to 'unexpected token', BUT only when run with gradle and as isolated test

I just installed intellij and downloaded the geb-example-grade (https://github.com/geb/geb-example-gradle). In Intellij settings I configured under gradle/runner: Run test using: Let me choose per test. Then I ran the test "can get to the current Book of Geb" with gradle and it worked fine also running the GebishOrgSpec class worked fine. Then I added a single quote to the methodname of the test, i.e. "can ' get to the current Book of Geb". Running the GebishOrgSpec class (containing that test) with gradle still works fine. But when I run the test with gradle (i.e. after Alt-Shift-F10 in the run menu I choose "GebishOrgSpec.can ' get to the current Book of Geb" instaead of "GebishOrgSpec") i get the following error:
FAILURE: Build failed with an exception.
* Where:
Initialization script '/tmp/ijtestinit3.gradle' line: 6
* What went wrong:
Could not compile initialization script '/tmp/ijtestinit3.gradle'.
> startup failed:
initialization script '/tmp/ijtestinit3.gradle': 6: unexpected token: get # line 6, column 49.
ludes = ['GebishOrgSpec.can ' get to the
^
1 error
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
Cause: startup failed:
initialization script '/tmp/ijtestinit3.gradle': 6: unexpected token: get # line 6, column 49.
ludes = ['GebishOrgSpec.can ' get to the
^
1 error
I also tried run running the test with Junit (after setting the driver path) that also works fine. For me it makes absolutely no sense that the very same test works when running the class but not when running the method of the class. Here just to be complete also the class code:
import geb.spock.GebSpec
class GebishOrgSpec extends GebSpec {
def "can ' get to the current Book of Geb"() {
when:
to GebishOrgHomePage
and:
manualsMenu.open()
then:
manualsMenu.links[0].text().startsWith("current")
when:
manualsMenu.links[0].click()
then:
at TheBookOfGebPage
}
}
Update: I had this behaviour on two different computers, but i would appreciate if others also test this. It should be fairly easy to reproduce (if there are questions on the description above, let me know.) Maybe u won't have the error and i have some bad configurations or u can confirm this bug and we raise the attention for it.

Jmeter-Ant xslt-report: BUILD FAILED Test.jtl does not exist error although i have Test.jtl

I am trying to run my Test.jmx file through below ant cmd:
C:\apache-ant-1.10.1-bin\bin>ant
I got the following error:
C:\apache-ant-1.10.1-bin\bin>ant
Buildfile: C:\apache-ant-1.10.1-bin\bin\build.xml
run:
[echo] funcMode = false
[jmeter] Executing test plan: C:\apache-ant-1.10.1-bin\bin\Test.jmx ==> C:\apache-ant-1.10.1-bin\bin\Test.jtl
_message_xalan:
xslt-report:
BUILD FAILED
C:\apache-ant-1.10.1-bin\bin\build.xml:124: input file C:\apache-ant-1.10.1-bin\bin\Test.jtl does not exist
Total time: 4 seconds
C:\apache-ant-1.10.1-bin\bin>
I fixed this issue by creating a new Test.jtl file.
Now I am getting this error:
C:\apache-ant-1.10.1-bin\bin>ant -Dtestpath=C:\apache-ant-1.10.1-bin\bin\ -Dtest=Test
Buildfile: C:\apache-ant-1.10.1-bin\bin\build.xml
run:
[echo] funcMode = false
[jmeter] Executing test plan: C:\apache-ant-1.10.1-bin\bin\Test.jmx ==> C:\apache-ant-1.10.1-bin\bin\Test.jtl
_message_xalan:
xslt-report:
[xslt] Processing C:\apache-ant-1.10.1-bin\bin\Test.jtl to C:\apache-ant-1.10.1-bin\bin\Test.html
[xslt] Loading stylesheet C:\apache-ant-1.10.1-bin\bin\jmeter-results-report_21.xsl
[xslt] C:\apache-ant-1.10.1-bin\bin\Test.jtl:1:1: Fatal Error! Premature end of file.
[xslt] Failed to process C:\apache-ant-1.10.1-bin\bin\Test.jtl
BUILD FAILED
C:\apache-ant-1.10.1-bin\bin\build.xml:124: Fatal error during transformation using C:\apache-ant-1.10.1-bin\bin\jmeter-results-report_21.xsl: Premature end of file.; SystemID: file:/C:/apache-ant-1.10.1-bin/bin/Test.jtl; Line#: 1; Column#: 1
Total time: 3 seconds
Actually, the correct answer is here. Just need to remove the comments from these lines:
<jvmarg value="-Xincgc"/>
<jvmarg value="-Xmx128m"/>
<jvmarg value="-Dproperty=value"/>
<jmeterarg value="-qextra.properties"/>
in the extracts\build.xml file.
Most likely your JMeter test is failing therefore it doesn't generate result file. I would suggest amending your target like
<jmeter
jmeterhome="${jmeter.home}"
testplan ="${testpath}/${test}.jmx"
resultlog="${testpath}/${test}.jtl"
jmeterlogfile="${testpath}/jmeter.log>
in build.xml file. The last line will "tell" the JMeter Ant task to generate jmeter.log file under the ${testpath}, you should be able to figure out what goes wrong by looking into this file.
References:
JMeter Ant Task Parameters
Five Ways To Launch a JMeter Test without Using the JMeter GUI
Adding to #Dmitri T answer jtl file is created only if you execute at least 1 Sample, so it won't be created in the following cases:
Your test plan failed and Stopped before executing Sampler
Your test doesn't contain Samplers
Your configuration is wrong and no thread were executed ( for example Thread number is 0)
You can try to execute/view/debug in GUI mode and check what's wrong.
use "resultlogdir" instead of "resultlog"
so change the build.xml like this:
<jmeter
jmeterhome="${jmeter.home}"
testplan ="${testpath}/${test}.jmx"
resultlogdir="${testpath}/log">
and also the "in" property in :
in="${testpath}/log/${test}.jtl"
I have no idea how to explain why, but it worked in my computer

TFS2015 Test Agent Aborted - PowerShell script completed with errors

I am running a TFS nightly build that for the last few days has not been able to complete all its tests. It fails after several hours with a "Test run is aborted" message. Previous to this the tests always ran successfully, and no major changes(or even minor) have been made to the system that runs these tests.
Information:
Two MStest runs in the build(unit tests)
Timeout is set to 20 hours
Runs for approx. 15 hours before failure
Tests are set to continue on failure
When I look in the TFS log for the latest run it lists the following(2017-04-11T06:42:47.5500707Z):
[warning]DistributedTests: Test run is aborted. Logging details of the run logs.
[warning]DistributedTests: New test run created.
[warning]Test Run queued for Project Collection Build Service
[warning]DistributedTests: Test discovery started.
[warning]DistributedTests: Test Run Discovery Completed . Test run id: 533
[warning]DistributedTests: 290 test cases discovered.
[warning]DistributedTests: Test execution started. Test run id : 533
[warning]DistributedTests: Test run timed out. Test run id : 533
[warning]DistributedTests: Test run aborted. Test run id: 533
[error]The test run was aborted, failing the task.
When I look at the run log(worker_20170410-234426-utc_864.log) I see:
06:42:47.659516 BaseLogger.LogConsoleMessage(scope.JobId =
7ced7f31-e360-47f3-b334-ef20faeaf000, message = ##[error]The test run
was aborted, failing the task.) 06:42:47.659516
Microsoft.TeamFoundation.DistributedTask.Agent.Common.AgentExecutionTerminationException:
PowerShell script completed with errors. at
Microsoft.TeamFoundation.DistributedTask.Handlers.PowerShellHandler.Execute(ITaskContext
context, CancellationToken cancellationToken) at
Microsoft.TeamFoundation.DistributedTask.Worker.JobRunner.RunTask(ITaskContext
context, TaskWrapper task, CancellationTokenSource tokenSource)
In the test log, I don't see any errors in the VS, just a warning about not able to connect(I see these often):
W, 2060, 5, 2017/04/10, 16:26:03.595, XXXTESTING\QTController.exe,
Test of LoadTestResultConnectString failed: A network-related or
instance-specific error occurred while establishing a connection to
SQL Server. The server was not found or was not accessible. Verify
that the instance name is correct and that SQL Server is configured to
allow remote connections. (provider: SQL Network Interfaces, error: 26
- Error Locating Server/Instance Specified)
I also see an error thrown in the Application Event log at the same time:
The description for Event ID 0 from source Application cannot be
found. Either the component that raises this event is not installed on
your local computer or the installation is corrupted. You can install
or repair the component on the local computer.
If the event originated on another computer, the display information
had to be saved with the event.
The following information was included with the event:
Error Handler Exception: System.ServiceModel.CommunicationException:
There was an error reading from the pipe: The pipe has been ended.
(109, 0x6d). ---> System.IO.IOException: The read operation failed,
see inner exception. ---> System.ServiceModel.CommunicationException:
There was an error reading from the pipe: The pipe has been ended.
(109, 0x6d). ---> System.IO.PipeException: There was an error reading
from the pipe: The pipe has been ended. (109, 0x6d).....
the message resource is present but the message is not found in the
string/message table
The issue is that I really don't know how to interpret these messages, each log just says "test run was aborted, failing the task", I'm not even certain the powershell issue is what caused it. I'm also not sure that the error thrown in the application log is related, though it was thrown at exactly the same time that the run failed.
It's also difficult to research this issue, when you really don't know what's causing the test agent to fail. There are posts related to VS, and to the TFS Test Agent, but these don't strike me as related issues, and of course there is this somewhat unhelpful post about the Powershell message.
Has anyone seen this sort of issue before? I don't think anything on my build server has changed over the last few days(maybe updates...), what do you think would cause an issue like this to occur?
If you look at the failed build(containing tests) after it is aborted in the "Build" section of TFS, its says it was "Aborted", that's it... If you look at results of the build(containing tests) in the "Test" section of TFS it specified that the test run "Exceeded Timeout".
Apparently MSTest was running up against the default value of this little gem. I think it defaults to 8 hours when not specified, but I'm not too sure about this. Anyways I set the following setting in my "Default.testsettings" file:
<?xml version="1.0" encoding="utf-8"?>
<TestSettings name="TestSettings1">
<Execution>
<Timeouts runTimeout="200000000" />
</Execution>
</TestSettings>
Seems to resolve the issue. Tests runs successfully and no longer time out.

Resources