Tagged Questions

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

learn more… | top users | synonyms

0
votes
0answers
18 views

Exist a Jenkins plugin that displays test result graph by category?

I want to develop automated GUI tests for a mobile application. The application has different areas. I want to use JUnit as testing framework and the Categories feature to assign each test case a ...
0
votes
2answers
71 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 = ...
2
votes
2answers
157 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 ...
0
votes
0answers
146 views

Testng giving null pointer exception

I have installed testng plugin using "http://beust.com/eclipse" site. I used option of adding new software to eclipse. Then i converted my junit test cases to testng. But the test cases which were ...
0
votes
1answer
21 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 ...
0
votes
1answer
45 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 ...
0
votes
1answer
82 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 ...
1
vote
0answers
107 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
1answer
83 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 ...
2
votes
1answer
145 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 ...
2
votes
1answer
858 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 ...
0
votes
1answer
484 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 ...
1
vote
1answer
93 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 ...
0
votes
2answers
1k 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, ...
3
votes
2answers
329 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 ...
1
vote
2answers
78 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
0answers
182 views

JBehave Assert.fail fails in console and not in JUnit (eclipse)

I asked this question on StackOverflow and have not gotten any answers, so re-asking here. I am trying to set up JBehave for our school project and am unable to figure out why an Assert.fail() in a ...
2
votes
1answer
570 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
1answer
159 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 = ...
1
vote
2answers
88 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 ...
1
vote
2answers
527 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 ...
0
votes
3answers
1k views

Selenium tests written using Junit are not running in order

I executed some selenium scripts, but they are not running properly. Execution is taking the scripts randomly and start execution. I want to execute the scripts as per script order. Please tell me a ...
0
votes
3answers
469 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, ...
0
votes
3answers
935 views

Best approach to use when values are dynamically created?

I'm looking for some advice on how to select a WebElement. When I click a button that creates a new 'page', the given value is dynamic, in that it is totally random and not sequential. I would expect ...
2
votes
3answers
4k 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

How to generate testing report in JUNIT in webdriver

I am using Selenium webdriver 2.0 in JUnit framework. I need to generate a report on my tuned both (positive and negative) test cases. NOTE: We have an option to generate report by default in ...
3
votes
5answers
10k 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 ...
1
vote
2answers
726 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
2answers
1k 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 ...
1
vote
0answers
152 views

How to test an SDK built for Android?

My company has an SDK for the Android platform. The SDK sends information to our servers. I need to be able to intercept, interpret, and analyze what the SDK is sending to these servers in terms of ...
0
votes
1answer
138 views

How to perform Selenium navigation before tests run without using JUnit 4.11+'s setUp or at the start of the test method?

How to perform Selenium navigation before tests run without using JUnit 4.11+'s setUp or at the start of the test method? We've got both navigation and bookmark based Selenium tests. The test code ...
5
votes
2answers
181 views

JUnit-friendly framework for production monitoring

My team deploys code to production every week or so. We have a large set of post-deployment validations, e.g.: New log lines are appended to Tomcat log (ssh to machine, tail -f the log) Database ...
5
votes
4answers
13k 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 ...
3
votes
1answer
501 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 ...
1
vote
1answer
219 views

JUnit Status Messages

Given I have the following class (See Parallelized Runner for more information on parallel runs): @RunWith(Parallelized.class) public class TopicTest { String topic; public TopicTest(String ...