Suppose I am running scripts by reading data(including runmode) from an XLS and storing the results also in a new copy of the XLS, what exactly would be the role of TestNG in the framework? Please help.. Thanks in Advance!!
Rajesh
TestNG is not just to manage the way you read your input parameters/data etc. It actually does a lot more. Try to answer these questions -
- How do you invoke some method always on a Class load ?
- How do you invoke some method before/after each method within your test ?
- How do you tell which is your test ?
- How to generate an HTML based report based on the log statements you have ?
The answer to above queries (if TestNG was not there) would have been really complex and would require quite some coding experience.
As suggested earlier, please read the info about TestNG and how it can be efficiently utilized and then again try to answer the above questions in this post.
Related
Really hope someone can help on this.
Is it possible to use 2 different external data files in the "Examples" in cucumber? like below:
#play_movie
Scenario Outline: play a video on the web site
When I choose a movie by "<movie_name>" and play
Examples: {'datafile' : 'src/main/resources/data/testData.xls' , 'sheetName' : 'movie_demo'}
There is one data file in this scenario, but what if I want to use 2 or more different data files in this scenario. Is it possible to do that in cucumber?
I'm using Java as the coding language.
Thanks.
Short answer is no, you can use only one external source at a time. You can paremeterize it but still it will be one source as result.
However, it's not that you can't do! You can have your custom data provider which can read multiple sources and returns test data.
Hi i am new to testng in selenium web driver..
in my testng.xml 19 classes are there i want to exclude 7 classes or sometime 14classes, is there any proper way to do it?please give some example if possible.
thanks
You are looking for test selection mechanism, based on certain criteria - let it be package or group. Yes, this can be done with TestNG. Here you have a number of detailed examples:
http://automatictester.co.uk/2014/05/10/selecting-tests-to-be-run-via-testng-xml-file/
I am re factoring large sets of tests in SoapUi.
Is there a way to automate creation and renaming of test cases/test steps through Groovy?
Thanks.
Possibly not what you're looking for but I've had some success manually editing the test suite xml using find and replace in a text editor. You need to be careful and make sure to back up a copy.
You can run Groovy code within SoapUI using SoapUI Groovy Console plugin. This way, you can change any property you want programmatically (within API constraints of course).
As for technical details on how to solve your actual problem, I can only refer you to this blog post and SoapUI's javadoc. Based on the blog post, you need to figure out what's given to you, and based on the API, you need to figure out how to achieve what you need.
In my case, I started with my project being bound as a project variable, and moved on from there.
There is really not so much information in the question about what you really need to achieve, but given the little you provided, one way to go would be to directly modify the soapUI project XML file. I have done this with some success in the past. The last I used soapUI, it UI did not come with massive refactoring functionality.
Hi there,
I’m starting to work with SOAPUI and Groovy.
I found the reusable code problem. I mean, I would like to avoid having a lot of copies of the same script in different projects.
As I want to make a "global library", how could I do it?
I saw the following method, http://www.spamer.me.uk/wiki/doku.php/soapui_reusable_script_library?rev=1350558275 but I have some doubts. Would it be the only way to do it?
Thank you very much for your help and sorry for the inconvenience.
You need create a JAR with your code and put it to bin/ext in your soapui directory (for example C:/Program%20Files/SmartBear/soapUI-Pro-3.0-beta-2/bin/ext/sqljdbc.jar ) so it will be added to soapui classpath
Sahi allowed me to enter the desired functions into a spreadsheet and then it would run those functions. Different combinations would result in different scenarios.Can i do something similar using selenium? I want to pick and call tests/scripts/functions through an excel file. I am currently using the testng framework to get data from excel files.
Thanks
Please check out the following blog for a relative answer on using data provider using TestNG for Selenium.
http://blog.varunin.com/2011/10/data-driven-testing-using-junit-and.html
There is no out of the box support. Spock framework has an excellent support for data-driven tests. A combination of PageFactory, Spock and Selenium2/WebDriver can provide you more than what you are looking for.
Sure, you could use a framework such as POI to read your Excel spreadsheet and return these values in a #DataProvider.