1

I run my test using Java, Selenium and TestNG.

When I execute my test suite I have it set up where the testng.xml has all the configurations to run my tests. I am wondering, if I can set up some UI component that does the same thing as the xml?

I am asking because I have nontechnical people in my staff and I don't want them to have to download an IDE, check out the project, etc. I want to create some UI where they can just go there and hit a button and the tests runs just like how I can right click on the testng.xml and hit run.

Michael Durrant
25.3k3 gold badges42 silver badges114 bronze badges
asked Nov 9, 2018 at 14:08

2 Answers 2

1

Actually, you can run the tests using Maven directly on the terminal:

mvn test

More details here, with options.

answered Nov 10, 2018 at 17:29
0

If you want to run your testng.xml files without any IDE or build tool, first you need to install Java on the system. In addition, you also need to set its path into the environment variable.

And first, you need to compile Java code using the command prompt. For this, you need to open the command prompt and go to the PROJECT_HOME directory.

Type Following command in terminal

javac -classpath libs/* -d ./bin ./src1/com/example/tests/*.java ./src2/com1/example1/tests1/*.java

if you are using windows then

dir /s /B *.java > javaFilePath.txt

This command will search all the .java files in current and subdirectory and put the entire Java file path in ‘javaFilePath.txt’ file.

You can compile the entire Java file using the below command.

javac -classpath libs/* -d ./bin @javaFilePath.txt

if you are using Ubuntu then

$find -name "*.java" > sources.txt$ javac -classpath libs/* -d ./bin @javaFilePath.txt

and after run the testing.xml file with using below command

java -cp bin;libs/* org.testng.TestNG TestNG/testng.xml

Now, you may run your testng.xml files without any IDE or build tool.

answered Feb 11, 2020 at 12:43

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.