How to create batch(.bat) file after creating suite from TestNG?Can anyone explain entire process?

Answers were Sorted based on User's Feedback



How to create batch(.bat) file after creating suite from TestNG?Can anyone explain entire process?..

Answer / ajmal

OPen Note pad and enter below code
java -cp bin;* testng TestNG nameOfYourXmlFile
save it as all files then change file type to (.bat)
thats it.. u can run it using CMD of jenkins tool..

Is This Answer Correct ?    1 Yes 0 No

How to create batch(.bat) file after creating suite from TestNG?Can anyone explain entire process?..

Answer / kiran

Before running the code, select the class from the Package Explorer, right click and choose the TestNG> Convert to TestNG. You will be asked to give file name which will be further saved as FileName.xml. And run the xml file once.
On the other side: open Note pad and enter below code
java -cp bin;* testng TestNG nameOfYourXmlFile
and save as the name given to that .xml file. But while saving give the name in double quotes. Ex: "FileName".bat

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Selenium Interview Questions

Explain me what could be the cause of selenium webdriver test to fail?

1 Answers  


Can we use selenium rc to drive tests on two different browsers on one operating system without selenium grid?

1 Answers  


Explain me how to execute javascript in selenium?

1 Answers  


How do perform drag and drop using webdriver?

1 Answers  


How to use regular expressions in selenium?

1 Answers  


How to enforce the title of the website?

1 Answers  


Different types of synchronization

1 Answers  


Name an api used for reading and writing data to excel files?

1 Answers  


What are the benefits of automation testing?

1 Answers  


Explain how you can login into any site if it’s showing any authentication popup for password and username?

1 Answers  


How to find whether an element is displayed on the web page?

1 Answers  


Explain about selenium-ide ?

1 Answers  


Categories