简体   繁体   中英

Creating TestNG .Bat File

Im having trouble creating a TestNG .Bat file (After several tries I have failed to create a successfull Bat file which will in turn execute my TestNG file 'testngSides.xml'.

I wish to execute the testng file: 'testngSides.xml' via a batch file, project structure: 在此处输入图片说明

I also have dependencies stored within the following location 'm2': 在此处输入图片说明

Many thanks for your help

Sorry could not write a comment due to lack of reputation. Add dependencies in your POM.xml to run the testing.xml(you will need maven surefire plugin too).Once dependencies are set, build your maven project and run maven test through your .bat file.

Create a .bat file with following content (edit it according to your project):

set myProjectpath=”PROJECT_PATH”
cd %myProjectpath%
set classpath=%myProjectpath%\bin;%myProjectpath%\lib\*
java org.testng.TestNG %myProjectpath%\testngSides.xml

Let me know if it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM