Do we need to install JDK to run WebDriver's TestNG tests through command line? - selenium

I am new to Selenium/WebDriver and created a project which I can execute through Eclipse IDE successfully. Now, I plan to run the test through command prompt by creating the proper TestNG1.xml and making sure the testng-6.8.5.jar is correctly pointed in PATH. I even tried giving full path of the testng-6.8.5.jar. Unfortunately I keep getting the error,
Error: Could not find or load main class org.testng.TestNG
I don't have JDK installed (and I don't want to install) so wondering if JDK is mandatory to run TestNG tests from Command line? From above error it looks like it's not even trying to access the TestNG1.xml I have.
I plan to distribute these tests as group of files to my fellow Business Analyst who only have JRE installed on their machine.

Yes, you need JDK installed where you are going to run your Test Here is some documentation of TestNG

Having JRE is enough to run the TestNG tests, or no need to install JDK to run the TestNG tests through command line
the issue was with the testng-6.8.5.jar library as selenium-server-standalone-2.32.0.jar was allowing me to run the project with no errors.

Related

TestNG options not display in Run As in eclips even I added Test NG Jar

I have added testng-7.4.0.jar in my project as external jar but I am not getting TestNG as options to run the program under run as in eclipse . I can see TestNg jar present in Referenced Libraries
I tried this in both version of eclipse oxygen and Neon
enter image description here
Install Testng plugin from eclipse market place and restart the IDE. And when you run it for the first time configure the run with run configurations.
You must have TestNG.xml file configured to run in eclipse.

Run Hybris unit test in intellij Idea community edition

i want to run hybris unit test using intellij community edition like how we do it on eclipse.
I don't want to use Hybris intergation plugin as it was failed to defect the unittest that are present in custom directory. when i try to run the test Intellij native build is triggering but not the ant build. and i am resolving the dependencies whenever intellij throws me build fail with those errors.
Can anyone help me to set this up or guide me through what all necessary steps to follow.
I am using latest version of community edition , Junit - 4 & Mockito for writing unit tests.
Thanks in advance.
I was able to Run the tests once i resolved all the errors that was throwing by intellij.
refer the Image here
Once you click on that run button, you get build errors, once you resolve those build errors then automatically that test will run. if it says shorten the command line then
Please refer this article by Intellij, hope this helps.

How to build RPM of a selenium test automation project with maven?

I have a test automation framework with test cases. I want to build an RPM of this whole project so that it can be installed on any machine and can execute the test. How can I do that?
One approach is to use a %check scriptlet in a spec file to run the tests during a build.

mono command line unit testing

I wrote a few nunit tests that I've run successfully in nunit on win7, and via MonoDevelop on my mac.
What I'd like to do now is run these tests non-stop (or until I kill it). I can't see any way to tell MonoDevelop to keep running over and over, so I'm trying to do this via the commandline.
Is there a way to run the MonoDevelop testing tool from the command line? I don't need reporting (my tests already report internally), just re-triggering every few minutes.
If there was a commandline tool, I could just wrap it in fabric or a shell script and just run it over and over...
Why don't you just use the normal nunit command line? It is contained with the standard Mono installation, available as nunit-console command.

Hudson CI: cannot test grails-app

I've tried in each and every way to test a grails-app using hudson. I've tried testing with maven, I've tried testing with the grails plugin and I've tried testing with a shell builder it seems that building via shell is the only thing that works..
Every time I get the same error:
org.hibernate.HibernateException:
contains is not valid without active
transaction
But If i go to a shell and type
grails test-app
everything runs fine.
Does anyone have any idea on what's going on?
I'm using CentOS with Java 1.6, no slaves, just a simple hudson deploy over Tomcat6.
I've tried both with maven and grails builder, both fail.
Edit: it seems that if I run both unit and integration tests on the same command (either with grails or with mvn) the integration tests fail always.
Hudson/Jenkins usually just use the command line for executing grails plugins (You should be able to confirm that from the build output). You could probably add a pre build step to dump the environment, so you can see if anything there (or in your own shell) cause it to be fundamentally different.
Otherwise try to log in as the hudson user and find the hudson workspace and repeat the process manually. That has been the easiest way to debug hard problems like this..
regards