Custom JUnit Report?

The junitreport task uses XSLT to produce the report from the XML files generated by the junittask. You can customize the output by specifying your own XSLT using the styledir attribute of the nested report element: <!– use reportstyle/junit-frames.xsl to produce the report –> <report styledir=”reportstyle” format=”frames” todir=”testreport”/> For customizing the the output, one option … Read more

Running Selenium scripts with JMeter

Below are possible ways to run Selenium test-cases from JMeter: using JUnit Request Sampler; using BeanShell Sampler; using JSR223 Sampler + Groovy. JUnit Request Sampler Running Selenium tests this way maybe useful if you want to re-use already automated (Java) Selenium scenarios instead of re-writing JS-scripts for WebDriver Sampler. Selenium RC Prepare Selenium test project … Read more

TestNG dependsOnMethods from different class

Put the method in a group and use dependsOnGroups. class c1 { @Test(groups={“c1.verifyConfig”}) public void verifyConfig() { //verify some test config parameters } } class c2 { @Test(dependsOnGroups={“c1.verifyConfig”}) public void dotest() { //Actual test } } It is recommended to verify configuration in a @Before* and throw if something goes wrong there so the tests … Read more

Run JUnit Tests contained in dependency jar using Maven Surefire

There is a way of running a test in maven from another jar. from maven-surefire-plugin version 2.15 you can tell maven to scan your test jars for tests and run them. You don’t need to extract the tests jar. Just add a dependency to your test jar and: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <dependenciesToScan> <dependency>test.jar.group:test.jar.artifact.id</dependency> </dependenciesToScan> … Read more

How to get entered text from a textbox in Selenium

The getText() method is for retrieving a text node between element tags for example: <p>Something</p> getText() will return “Something” In a textbox typed text goes into the value attribute so you can try something like: findElement(By.id(“someid”)).getAttribute(“value”); ComboBox is a bit different. But if you’re using the Select object you can use the method: Select selectItem … Read more

JUnit test class order

In JUnit 5 (from version 5.8.0 onwards) test classes can be ordered too. src/test/resources/junit-platform.properties: # ClassOrderer$OrderAnnotation sorts classes based on their @Order annotation junit.jupiter.testclass.order.default=org.junit.jupiter.api.ClassOrderer$OrderAnnotation Other Junit built-in class orderer implementations: org.junit.jupiter.api.ClassOrderer$ClassName org.junit.jupiter.api.ClassOrderer$DisplayName org.junit.jupiter.api.ClassOrderer$Random For other ways to set configuration parameters (beside junit-platform.properties file) see JUnit 5 user guide. You can also provide your own orderer. … Read more

Unrooted Tests

Finally I found the solution. The problem is that you are not defining your test cases using annotations but are still doing it the “old way”. As soon as you convert over to using annotations you will be able to run one test at a time again. Here is an example of what a basic … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)