Questions tagged [nunit]

NUnit is a unit-testing framework for all .Net languages

Filter by
Sorted by
Tagged with
11
votes
5answers
31k views

How to start a Selenium2 WebDriver window in background?

I have a series of Selenium2 test cases in C#/NUnit that are run sequentially. Each test case runs in a new instance of the WebDriver (and this is necessary) - which means that each time a new test ...
9
votes
2answers
5k views

NUnit: Global error method/event for handling exceptions

I'm looking for a way to catch exceptions globally in my NUnit project class library. So if one of my unit tests throws an exception, I can catch it in one spot. I don't want to surround each of my ...
7
votes
3answers
3k views

What is the best way to handle minor intermittent automation failures during cross browser testing?

I run Web Driver (.Net version) with SpecFlow as my test driver on some fairly general Cross - Browser scenarios so I often am rerunning tests as I add new ones, or clean up old automation. On ...
7
votes
4answers
9k views

Is there any framework for UI automation testing for Unity3D?

Does anyone know any framework that is compatible/integrated with Unity3D? I'm interested in Unit, Integrated and UI testing.
6
votes
5answers
74k views

Locating element by link text (anchor tag innerHTML) or xpath fails in Selenium 2.0 Webdriver

I'm using Selenium 2.0 web driver. My script keeps failing whenever I try locating something in my page. It throws an exception whether I locate the element by LinkText or by XPath. driver....
6
votes
2answers
2k views

How to make run only failed test cases in NUnit

Can anyone please tell me how to run only failed test cases using NUnit.
6
votes
2answers
2k views

How to ignore a test in C# when CurrentEnv is Prod

I have created a ProdIgnoreAttribute which extends from IgnoreAttribute. And I have assigned this attribute to certain tests which I want to run in DEV/QA but not in PROD. ApplyToTest(Test test) ...
5
votes
3answers
3k views

Can NUnit be used for Functional and Regression testing?

Now, here the confusion starts. I was creating some test cases using Selenium WebDriver with C# and thought of using a testing framework. My task is to create functional test cases which can later be ...
3
votes
2answers
10k views

Selenium 2.0 WebDriver: Clearing Session Data

Is there a way to clear out session data for a driver instance in WebDriver? My code is written in C# (and NUnit), but I'm not picky on the language for the answer.
3
votes
3answers
1k views

Is there an Interface to Run Selenium 2.0 WebDriver Test Cases other than NUnit?

Is it possible to wrap around Selenium 2.0 WebDriver Test Cases with anything other than NUnit for C# code? Or perhaps NUnit has a nice application to do this with? If not, how can I wrap around the ...
3
votes
2answers
3k views

Test recording with Selenium IDE vs manual programming test framework

I'm just beginner in this field. I have already created simple tests using Selenium in .NET environment together with NUnit. I also hard coded the same or similar tests for my framework. My question ...
3
votes
2answers
362 views

Is NUnit a viable choice for a starting long term project these days?

I currently participate on the decision to pick a unit testing framework for a bigger long term project. NUnit, being an ubiquitous unit testing tool, would make it a natural choice for me, but not so ...
3
votes
1answer
2k views

Deploying Selenium RC tests with Teamcity

I'm looking at setting up my Selenium tests in a QA environment which will run with a Teamcity build each time. This seems to be the best resource I've come across so far where someone has gone ...
3
votes
1answer
274 views

Not displaying nunit tests in visual studion after NUnit integration in Visual Studio

I have downloaded the vISUAL Nunit 2010 and also edited the .vbproj file guid. But still Visual Studio is not displaying nunit tests. Any idea what I am missing here.
2
votes
1answer
2k views

Functional Difference between NUnit and MSTest in VS

We are using VS Community 2015 and have the choice of developing under the MSTest or the NUnit framework. We are building a testing framework using Legitest (unit, integration, system, etc) for ...
2
votes
2answers
1k views

Setup of Test automation framework from scratch using NUnit and Specflow and RestSharp and selenium with Visual Studio 2017 C#

We have so many API's(5 to 8 API calls - Mostly REST based and 1 or 2 in SOAP based) and Oracle DB. We do not have any WEB UI. No UI automation.Only middle tier and backend automation. For automation ...
2
votes
1answer
1k views

Retry in nunit not working when test times out

I am using Timeout attribute for nunit test case as below: [Test, TestCaseSource("TestCases"), Retry(2), Timeout(10000) public void test(){ // Some code that runs for more than 10 seconds } I ...
2
votes
2answers
6k views

Error: System.NullReferenceException error in Selenium with NUnit

I'm getting following error at verification stage: "An unhandled exception of type 'System.NullReferenceException' occurred in nunit.framework.dll Additional information: Object reference not set to ...
2
votes
1answer
814 views

Selenium Grid sending commands to the wrong node

I am working on setting up a distributed testing environment and am running in to an interesting issue. When running tests in parallel the tests seem to get routed to the correct nodes and execute to ...
2
votes
2answers
6k views

Execute a particular test using command prompt and Selenium, NUnit, Test cases written in C#

I have written a number of test cases in C# for UI which uses Selenium Webdriver (I am new to Selenium). I would like to run a particular test case out of N number of test cases through command ...
2
votes
1answer
1k views

Is it possible to change the location of NUnits TestResult.xml

When running tests with the NUnit GUI application, is it possible to change the location of where NUnit creates the TestResult.xml file after the test has completed? It is usually created in the same ...
2
votes
1answer
45 views

Re-using a system test (in NUnit3)

Typically, (unit) tests should be independent and work on their own, however, in system testing we face different requirements. For example, I am implementing a test for a setup. Standard ...
2
votes
2answers
301 views

Benefits of BDD tools such as SpecFlow for tech debt in automation

We are starting to automate our manual regression suites using Selenium Webdriver and NUnit. The tests we will be automating are quite detailed in terms of steps and expected results however I was ...
2
votes
1answer
2k views

Nunit3: how to save the test results while tests are running

NUnit3 Console runner saves test results in xml at the end of the test run. But in my case I want to save the partial results on each test failure, so that in case console runner crashes or is stopped,...
2
votes
1answer
7k views

Kill browser sessions when driver is instantiated on each test

I am developing a testing framework for an application at my work and am running in to an issue. I use Selenium 3.0.1, NUnit 3.5.0, NUnit3TestAdapter 3.6.0, and a Selenium Grid instance to run my ...
2
votes
1answer
954 views

How to see ongoing progress of my Selenium tests run in NUnit on Jenkins?

I am running my tests in Selenium using NUnit and Jenkins and it takes more then 2 hours to run all tests. I want to see the progress of the tests for monitoring if everything is OK like a team city ...
1
vote
3answers
2k views

NUnit3: Log assert description when it fails

On test failure Nunit will only show evaluated expected and actual conditions. There is no way to tell which Assert failed if you have multiple asserts Expected: True But was: False I know that we ...
1
vote
2answers
616 views

unit testing vs automation selenium resume value [closed]

I started working in automation development with selenium and am told it is a hot field and can earn some high-end coding salaries. We recently hired a new manager who once hired immediately took us ...
1
vote
1answer
72 views

Getting error while adding Test annotation in project using NUnit

I encountered with some errors when tried to add the NUnit Annotation to my code as shown in below image. I have done some error research from Here and here also following instructions from here too ...
1
vote
1answer
794 views

Teardown of Multiple Threaded Tests with Selenium

I'm trying to run multiple test cases with Nunit in C# in which every test needs its own Selenium Chrome Driver. Before it was threaded, I handled the chrome driver with [Setup] and [Teardown] like ...
1
vote
1answer
1k views

Visual Studio 2012 + NUnit unit test integration

I am having a problem with integration my NUnit test integration. I have installed the test adapter for NUnit and also made sure that the extension is enabled, but no test are shown in the test ...
1
vote
1answer
130 views

NUnit Assert.This(obj, method) for C# - where to find list of evaluation methods?

I'm an old embedded coder, new to NUnit and VS C#. I'm trying to get used to the Assert.That(obj,[EvaluationMethod]) methodology that NUnit 3.x is promoting. I'm slowly getting up to speed, but was ...
1
vote
1answer
266 views

Closing Driver after all test are runned

I'm using Nunit + .NetCore 2.2 in my project and I need to close the browser only after running all the tests and not after each test class. Currently the tests are closing the browser after each test ...
1
vote
1answer
2k views

Dll file is missing in my Debug folder (C#-Selenium)

I am trying to run my Automated test cases from the command line. My tests were written in C# - NUnit-Selenium-Webdriver. I opened my solution in file explorer then navigated to Bin--> Debug, but I ...
1
vote
1answer
3k views

How to fail NUnit test by default (I want to call Assert.Pass when it should pass)

I have medium level experience on unit testing and now I'm learning about NUnit. As far as I can see, a NUnit test passes by default if you don't call Assert.Fail method. In my test case, I want it ...
1
vote
1answer
2k views

Handling multiple Iframes with same name

I am trying to navigate on a web browser that has multiple iframes that are all tagged with the id of "InlineDialog_Iframe". When I try to switch to the window I get a stale reference exception, which ...
1
vote
1answer
2k views

Creating Test Suite dynamically in NUnit

I would like to create a test suite using NUnit. In java, I could use the name of the classes and do something like this: TestSuite suite = new TestSuite(); suite.addTest(new JUnit4TestAdapter(Class....
1
vote
3answers
738 views

Nunit not working

I'm new to NUnit and I just download it and installed .But while opening project i got exception as " Load Failed" System.IO.FileNotFoundException... Why am I getting this exception? Please help ...
1
vote
0answers
220 views

How do I make a custom logger for Fluent Assertions?

I'm using NUnit and Fluent Assertions for testing. I'd like to write a custom logger for my test steps which shows which steps have passed and the step (if any) that failed. It looks like someone has ...
1
vote
1answer
1k views

Unable to load MS edge chromium with Selenium

I'm trying to load the msedge chromium. encountering error. Steps to recreate: Installed mschromium Beta and Dev versions. Installed the Nuget package "Install-Package Selenium.WebDriver -Version 4....
1
vote
1answer
235 views

I am trying to validate the following in page: Unit testing text and existence of Test Automation Interface Model picture [closed]

I am using the C# selenium, Specflow and Nunit3 for performing above task. I am confused that how to validate the page. Later on, following task already i have done. Moreover, it Search for the link ...
1
vote
1answer
3k views

BDD specflow Error: "Ambiguous Step Definition Found For Step

I am getting this error: "Ambiguous Step Definition Found For Step...." on running my Specflow Test. The code is for the client that I am working for, thus I am not permitted to provide code sample. ...
1
vote
0answers
298 views

How to refer custom jquery and bootstrap path in karma-html-detailed-reporter's reporter.js file?

I am new to TDD. Currently, I had run more than 2000 test cases parallel with chrome headless browser using concurrently-npm package. All the test cases are working fine. If any of the test cases get ...
0
votes
4answers
85 views

Automated Way To Prove Robustness Of Tests

I have an automated test suite of NUnit Selenium tests written in C#. I am trying to test for my test suite's robustness by running my entire suite say 50 times and viewing an amalgamation of the ...
0
votes
3answers
993 views

How to automate functionality of this complex web application?

I am tasked with creating regression suite from scratch for this huge, confusing mess of a software. General idea is like this: User presses "Create this thing", first step of thing creation is ...
0
votes
1answer
167 views

Once an exception is thrown, it shouldn't ideally go to a TearDown/ aftertest

I'm using the NUnit framework. If my test-case failed with an exception like a timeout or any other exceptions. After the test it should go to [Teardown] but it is not going struck there abort the ...
0
votes
1answer
36 views

Testing my own stack class

Im creating a very simple stack class to implement my learnings on TDD. I have created a test that will create a stack and check the length of it. This is my test class: using NUnit.Framework; ...
0
votes
1answer
51 views

Running test suite setup once in every node of Selenium Grid

I am testing an application which would require to configure it into dev mode before test execution. (set the application to point into dev backend instead of live) The configuration itself is ...
0
votes
1answer
1k views

How to run multiple test cases sequentially in NUnit Console Runner

I'm trying to run nunit3 exe through Jenkins but after building the project, it runs all available test cases parallely. They should run sequetially. I tried where clause in nunit but how it will ...
0
votes
1answer
430 views

WebDriver Exception was unhandled by user code C# NUnit Selenium

Till yeaterday i.e. 17th July 2018 I was able to successfully run my testcases. But now I'm getting below error: A exception with a null response was thrown sending an HTTP request to the remote ...