I want to create bat file, The Selenium Project is been developed using TESTNG and Java. I have suite in xml. - testing

Now i want to create bat file, Please file in creating bat file.
I don't have main function in my project.
I want to run the test suite in Main class. How can i do that ? Source code please.

You can generate your xml from main function.
I can provide source code, but it is against policy of stackOverflow.
first show your research.
I think many might have answered this.
Hint: use TestNG class
and add XMLTest, XMLSuite and XMLClass objects to it.

Related

Refactor the name of a Cucumber step definition in multiple .feature files in IntelliJ

Suppose a Cucumber step definition for which I would like to change the name on multiple .feature files.
#Then("^the step which I need to rename in multiple .feature files:$")
I was wondering if there was some IntelliJ plugin support to allow such refactoring.
If you right-click on the step in .feature file there is an option for that: Refactor -> Rename.... But it doesn't work as expected =)
Here is an issue for this: https://youtrack.jetbrains.com/issue/IDEA-152772
Best thing you can do so far is to upvote it...

Folder specific cucumber-reporting without parallel run?

Was wondering if I could get setup cucumber-reporting for specific folders?
For example in the https://github.com/intuit/karate#naming-conventions, in CatsRunner.java i set up the third party cucumber reporting? without parallel execution. please advise or direct me on how to set it up.
Rationale. its easier to read and helps me in debugging
You are always recommended to use the 3rd party Cucumber Reporting when you want HTML reports. And you can create as many Java classes similar to the DemoTestParallel in different packages. The first argument to CucumberRunner.parallel() needs to be a Java class - and by default, the same package and sub-folders will be scanned for *.feature files.
BUT I think your question is simply how to easily debug a single feature in dev-mode. Easy, just use the #RunWith(Karate.class) JUnit runner: video | documentation

What files I should use in Automation testing framework

I am making Automation Framework using Selenium , JAVA, Maven, TestNG & Eclipse.
So my question is regarding which TYPE OF FILE I should use for:
Keeping test Data ? (Right now I am using XML file as it is light &
free unlike Excel)
Creating test case. ? (Currently I am using simple .Java text file for each test case)
For creating Reports ? (Thinking to make XML report & then display it using HTML file)
Will be nice if you share Pros & Cons along with your views/recommendation/suggestion.
I think this will help me finalize my file structure. We can add functionality & facilities anytime.
Thanks a lot.
Keeping test Data, you might want to try using .Java files to store data, then use getter and setter. If you are using TestNG you can use the annotation #DataProvider() which will really help you on keeping test data.
Constants can also be put in . Java files as an interface
Creating test case --> It is a good thing to use .Java file
Creating reports --> Yep, you got the idea. Try to use TestNG, it's easy to set up.

How to resuse selenium test file in another selenium test

Is there way where I can use one selenium test file in another test file like an include directive or something?
I do not want to create duplicate files, there is only one change I have to make in an existing test file so I thought if there was a way to use an existing test file ?
Thanks for your reply, I am using Ruby
It depends on what language you use for coding. In java to reuse another selenium test file we use the import directive. If you are using java I can show you a sample pseudocode.
What language are you using?

JavaFX directory file list

Has anybody know with what command I can get all files names in directory ?
I can`t find in tutorials.
pls, Help me
Do you know that you can, in JavaFX scripts, directly use Java classes ? As a consequence, getting all file names in a directory in JavaFX works exactly like in Java (as JavaFX does not contains those kind of classes, focusing as it is on UI creation)j, that's to say by calling File#listFiles()