JUnit is a unit testing framework for the Java programming language.

learn more… | top users | synonyms

0
votes
0answers
3 views

configure sessionFactory using mockito

I am writing mockito junit test case. In my (spring integrated with hibernate) web application there is one common xml file named as application-config.xml. Which contains the hibernate configurations ...
1
vote
2answers
117 views

I need to run a project build using selenium webdriver/maven/junit with jenkins

I have a selenium webdriver live project build using maven and junit framework. I want to run this using jenkins. I google searched but was able to find information when the project is build using ...
0
votes
0answers
10 views

load application-config.xml (spring+hibernate) file from test case

I am using application-config.xml file in which the hibernate configarations are included. When I run my test case (using Junit with Mockito), I want to call an abstract class HibernateUtil. Here it ...
1
vote
2answers
23 views

How to handle InvalidElementStateException message

I want to type 'calculator' on google text box so for that i wrote below code, its execute fine but there is 'InvalidElementStateException' message display so please help me how to solve that problem. ...
0
votes
2answers
242 views

How to run Junit test methods in parallel?

I need to run Junit test methods in a Class parallelly to save time using Threads. I have added the following code in my pom.xml file after referring to a website. please let me know what the next ...
0
votes
1answer
84 views

Selenium: Isolating Assert Fail in Excel Data Driven Loop

Firstly I would like to point out that I'm a beginner when it comes to selenium so I apologise if this is not presented appropriately. I would like to incorporate data driven testing into my ...
3
votes
9answers
968 views

What are good resources for a manual tester to transition to automation?

Nervously looking at job posts, automation and programming is no longer "good-to-have". It is almost a must. I'm a manual tester looking to start working towards automated testing/test automation. I ...
2
votes
2answers
114 views

Junit 4 checkbox in jmeter getting cleared when running test

I wrote a junit 4 test case. The test is using selenium web driver. It works fine when running from eclipse. I then copied the exported jar file to jmeter lib/junit folder. The class name and test ...
0
votes
0answers
9 views

Export JUnit XML for a Protractor Cucumber-JS run

I am setting up a new project with Protractor and protractor-cucumber-framework. I cannot seem to find any resources on the cucumberOpts and how to export the results of the test(s) as JUnit XML. '...
4
votes
7answers
30k views

Take screen shots using selenium webdriver

How to take screen shot on both test cases "Positive and Negative" results. NOTE: Currently, iam working in selenium webdriver (junit) and i didnt have an idea about how to code for adding methods to ...
5
votes
2answers
3k views

How and where to store dynamic result/data using webdriver java

I want to know "How and where to store dynamic (Search results) result/data", I am getting the results and not sure what to do next. Also, after saving these results I want to use this in another ...
2
votes
2answers
98 views

How to generate test cases for JUnit?

Explanation We are currently using a self-made testing framework/tool, to test services of an client-server application. The framework currently works with own implemented JUnit like assert methods ...
0
votes
2answers
758 views

Using Jtidy to parsing HTML

I am using Jtidy I pass an InputSteam and then I tried to validate whether or not the XHTML code in the InputSteam is valid. InputStream s = new ByteArrayInputStream(my_string).getBytes(...
4
votes
2answers
226 views

What is the difference between jUnit & TestNG?

I want to know difference between Junit & TestNG. Which one is useful for Tester?
3
votes
1answer
183 views

Handle conflicts in parallel execution of jUnit testruns using the same database

I am actually working on how to manage the execution of many jUnit classes calling the same database, the tests interact using Web-services. If it is possible, it would be a great help if you would ...
0
votes
0answers
30 views

How to execute single .jar file with Webdriver/JUnit tests for a WordPress plugin on Travis-CI?

I've created some Webdriver/Junit tests for a WordPress plugin. My usual workflow for creating and executing them goes like this: Write test in Eclipse IDE and add (as new class) to my "Tests" Java ...
2
votes
3answers
380 views

Selenium opens browser and loads page, then stops

Selenium opens browser and loads page, then stops. I have inherited a selenium project with no internal documentation and I'm a bit stuck on how to get it up and running (I am new to Selenium). We've ...
3
votes
2answers
80 views

Which test execution framework for Java has the highest test coverage?

I found TestNG failing occasionally and when I started to investigate I found it has little test coverage. It looks like the test framework itself is poorly tested. Which other test execution ...
0
votes
1answer
55 views

Is this a good idea to test if text messages are exactly what they are?

I have been told that testing java exceptions' messages is a good thing, but it looks so much like redundancy that I cannot believe it. Consider following fictional code: public class ...
3
votes
1answer
44 views

Enforced Folder Structure in Java for Uploaded Files [closed]

I am looking to create a system where a clearly-defined local filesystem folder structure follows a specific pattern. Programmatically or manually violating the pattern should throw an exception. ...
4
votes
5answers
324 views

What should I learn next as QA

I have been working as a software tester for the last 4 years. I have the following skills and day job experience: 1 - Manual Testing of websites & Mobile Applications. 2 - Automation using ...
1
vote
1answer
46 views

How to avoid hidden bugs caused by test doubles?

I just got the Mockito framework for Java to try out mocking with JUnit. Trying it brought me to a basic question that I am sure is obvious but I have had trouble finding any answer for, probably ...
1
vote
1answer
290 views

Using tagged hooks to run tests with different browsers

I've looked at resources like here and here, but these solutions are not working for me. What I want to do: without involving much heavy machinery (unless I have to) and without using a third-party ...
0
votes
1answer
164 views

Change the title of a webpage in JUnit test with Selenium Web Driver

I want to write an automated JUnit test script with Selenium Web Driver to load a Wikipedia page and then change the title of the page loaded. import java.util.regex.Pattern; import java.util....
2
votes
2answers
3k views

Selenium WebDriver how to name each screenshot taken after a test based on the test name

I am currently using the following method to take screenshots after each test, and it works fine: @After public void takeScreenshotAtEndOfTest() throws IOException { File scrFile = ((...
0
votes
0answers
166 views

How to Automate Rich Text Editor in RC?

I got the problem when I was trying to automate a twitter account- to send a new tweet. The text box has changed to rich editor(I am not sure though). When I tried to record it using IDE, it is not ...
0
votes
3answers
214 views

Is it worth it to learn an automated testing software as a Java web developer?

I want to learn Selenium web driver (or JUnit), but I'm hesitating on whether to learn it or not because my work is not focused on testing. I do maintain and develop Java web based applications and as ...
0
votes
1answer
618 views

Ant compile failed, packages do not exist

I'm trying to compile my maven test project in intellij and everytime i compile, i get this error: Buildfile: /Users/username/Desktop/workFiles/maven/MavenProject/build.xml setClassPath: init: ...
0
votes
2answers
247 views

How to execute Selenium + Junit Tests on Chrome

I have downloaded the Chrome Driver and i am able to execute my tests on Chrome. However Only local connections are allowed for it. How can i execute it globally on any machine without changing ...
5
votes
2answers
1k views

How to manage application data when running multiple tests in parallel?

Our functional test suite is slow I have inherited a functional test suite using Selenium 2 (Webdriver) and Junit. We have around 500 tests written for our Java web application. Running the full ...
4
votes
5answers
18k views

How to make my tests more robust in WebDriver using JUnit (code included)

I'm hoping someone can advise me on some best practices to make my tests more robust. The problem I'm having is that every so often my tests will fail at the point of WebDriver waiting for an ...
1
vote
2answers
3k views

generating html report from soapui test results when running from maven & jenkins

I have a SOAPUI Project file with number of test suits. I have wrote a maven project to run that project file. I am running that maven project (pom.xml) through jenkins. As you can see in the pom.xml ...
1
vote
3answers
3k views

How to execute parallel junit tests with maven surefire

I'm using selenium webdriver, Junit 4.9, maven for testing. Now I need to parallel tests. I added the plugin below, then tried to run it from IntelliJ IDEA 11, but it was still running sequentially. ...
0
votes
4answers
2k views

Using WebDriverWait to verify a performed action versus assertions in JUnit

Can someone tell me if by using the following code is sufficient enough to verify that the actions performed have taken place. So by using a wait command for certain elements to be visible in the DOM, ...
1
vote
1answer
811 views

How can I use Surefire to run parameterized tests in parallel?

I am using jUnit's Parameterized annotation on some Selenium tests to specify the browsers they should run with. I am also using SureFire's new parallel parameter (set to "classes") to try and run ...
0
votes
2answers
4k views

Selenium session timeout

I have a session timeout problem like this: I am using selenium + webdriver + java(junit) While testing each(tab) test case of particular web page in one programme, i need first test Login button, ...
0
votes
1answer
67 views

Testing Verify Method Call Without Argument In Test Class

I have a class which takes a message with payload String. The payload is then split and used to create an Entity which is passed to DAOInterface to persist. How can you test the call daoInterface....
0
votes
1answer
5k views

Calling data from one class to another class - framework for JUnit

Please forgive me as I am still very new to the world of test automation. I have started out by using Selenium WebDriver with JUnit4, predominately on windows OS, although I have modified my scripts ...
0
votes
1answer
82 views

Android JUnit With Varying Network Conditions

I have written a suite of tests for our company's Android app using Android JUnit and Robotium. I have written a Utility that can enable and disable networking for a device. My Question is: "Is ...
7
votes
4answers
44k views

Webdriver Check if Checkbox is Set and Set it if Not

I am learning Webdriver with JUnit by going through Alan Richardson's Selenium Simplified book and taking translating the exercises/tests from Selenium RC to Webdriver. So far, this has proven to be ...
0
votes
1answer
274 views

How to compare value of a td of a table with a numeric value using webdriver?

I have to compare a value of a td tag with a numeric value. I have o check whether the value coming in that td is >= some value. The html of td is: <td class="sorting_1">78000</td> I ...
2
votes
1answer
4k views

How to run multiple browser instance with Webdriver, Java, and Junit/TestNG?

I have a test ready to be executed but it takes a long time to finish. In this test I'm feeding in csv data, so basically the whole test will run 56 times. I was wondering if there's anyway I could ...
4
votes
1answer
633 views

Parameterized JUnit tests with HtmlUnitDriver leading to test termination

I came across an unusual issue with my automation tests while using the HtmlUnitDriver. I have been using the junit parameterized class to iterate over a list of urls to run some of my tests. The test ...
2
votes
1answer
333 views

Selenium JUnit DOM Testing - Problem with counting Dynamic rows

I have a DOM structure "div > table id = 't1' > tbody > tr" (count of tr changes on resize) The javascript function changes the number of rows on resizing the browser. I want to count number of rows ...
2
votes
2answers
96 views

Test results that differ from running via command line versus IDE

I have just run a set of automated tests via the command line using Maven as my build tool and JUnit4 as my test execution framework. There was a report of two errors which were recorded in a text ...
0
votes
1answer
347 views

Alerts: How to assert a given paragraph

Using WebDriver and JUnit 4.11. I'm attempting to find an alert and assert the body of the alert paragraph. My code is: @Test public void dNameField(){ WebElement nameField = chrome....
2
votes
1answer
2k views

What are the Selenium, JUnit, Ant and JScover and how they are combined?

I am given a javascript function which takes as input some numbers and returns the max, as a part of a project at the university, and I have to test it, using Selenium, JUnit, Ant and JScover. I have ...
0
votes
2answers
4k views

JUnit ParallelComputer Runs All Test Classes As One

I'm building automation testing for web application by using JUnit 4.9 and Selenium Webdriver. It's time consuming. So I'm trying to experiment with ParallelComputer. I'm wondering how can I get ...
2
votes
2answers
2k views

Code Coverage for Web Applications?

Does anyone have any experience using code coverage tools for web applications? I primarily work with Webdriver and JUnit, but I am not sure if we are covering all the possible cases. This may ...
1
vote
2answers
125 views

Assertions and Outputting Specific URLs

Here's what I've done so far. @Test public void test() { String[] list = {}; for (int i=0; i<list.length; i++){ driver.get(baseUrl + "/" + list[i]); boolean ...