testng

In testng, Why the @DataProvider run before @BeforeClass?

Using TestNG, why does the @DataProvider run before @BeforeClass? seems sometimes DataProvider run before BeforeClass some time not? Anybody knowing the reason? Many thanks!! ...

Multiple testng.xmls in the same IntelliJ run configuration?

I have a project that has two different modules each with its own set of testng tests. I have separate run config's with code coverage enabled for each. I need to run both to gather coverage statistics and was wondering if there was a way to consolidate the coverage data in to a single session. Is it possible to create a run configura...

Question on TestNG

TestNG doc says create an xml as below. <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > <suite name="Suite1" verbose="1" > <test name="Regression1" > <packages> <package name="test.sample" /> </packages> </test> </suite> Where should this file be? ...

Why doesn't Selenium return from this internal HTTPS URL?

Can someone please tell me why Selenium can't return from opening this internal HTTPS URL? https://red1cert.red-usa.com:37443/index.php3 After a call to selenium.open("https://red1cert.red-usa.com:37443/index.php3"), Selenium hangs and after a very long while, it terminates with server error. Help please. ...

help - testng doesnt work on the mac with eclipse: Bad version number in .class file

To get latest Helios eclipse + subclipse + m2eclipse and mvn to work on the mac, I had to make the "default" jdk 1.6 thusly: cd /System/Library/Frameworks/JavaVM.framework/Versions ln -s 1.6 CurrentJDK AND I had to enable 1.6 using the applications/utilities/java preferences app. Now eclipse, and mvn work, with 1.6 set as the target ...

Refering a Parameter to another Parameter in testng.xml file

I have the following in testng.xml ... <parameter name="Empl_Name" value="Stephen" /> <test name="Employee Search test" junit="false"> <parameter name="Valid_Empl_Name" value="${Empl_Name}" /> <classes> <class name="org.EmployeeClass" /> </classes> </test> The above is not working. My requirement is that I want...

testng: why I can not run test based on group

I want to lauch all my integration tests (group=inttest) so I write this xml config: <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"&gt; <suite name="Service Integration Test" parallel="none"> <test verbose="1" name="Service Integration Test"> <groups> <run> <include name="inttest.*"/> </run> </gr...

For TestNG, what is the proper method for pre-populating the data source containing a complex model when it will be queried using Hibernate?

I wish to write tests for our Seam Framework-based web site's internal search engine that uses Hibernate + Lucene indexing (on DB2) for queries. What is the best solution for populating the data source before the TestNG suite is run when the project's data model is quite complex considering entity relationships and field constraints? For...

How to disable testng test based on a condition

Hey Guys, Is there currently a way to disable Testng test based on a condition I know you can currently disable test as so in Testng: @Test(enabled=false, group={"blah"}) public void testCurrency(){ ... } I will like to disable the same test based on a condition but dont know how. something Like this: @Test(enabled={isUk() ? false ...

Multiple levels of setUp/tearDown in TestNG?

In using TestNG for my Selenium framework, the setUp method is relatively complex. There are multiple points that it can break and I would like to split it into separate steps. Ideally it would look something like this: // Does some DB stuff, logs some messages @BeforeMethod(alwaysRun = true) preTestCase // Instantiates and opens up ...

TestNG gives "Connection Refused" while running on Eclipse

I'm trying to run Selenium tests with Selenium-RC using TestNG on Eclipse. When I try to run a test, I get something like the following console output: org.testng.TestNGException: Cannot establish connection: 127.0.0.1:1613 at org.testng.remote.strprotocol.StringMessageSenderHelper.connect(StringMessageSenderHelper.java:94) at ...

Testng terminal report

I run test cases from maven, that is from command line. Is there a way to see a reason why test failed in terminal output? I've tried raising verbosity in testng.xml to 4,hoping that it will activate TextReporter, which seems like class that prints, well, text reports, but it didn't help. ...

running TestNG as an ant task causes an error

While I'm trying to run TestNG from ant as a 'testng' task, i'm getting strange behaviour. TestNG does not create class instance in @BeforeSuite method and in child classes in @Test method i'm getting NullPointerException. E.g. public class TestBase { Page mainPage; @BeforeSuite public void login() { ... ma...