Questions tagged [nunit]
NUnit is a unit-testing framework for all .Net languages
65
questions
0
votes
1
answer
14
views
Recommendations for a beginner using Playwright in C# for Blazer app
I'm new to test automation and do not have a coding background. I need to create tests using Playwright in C# for a Blazer app. Can anyone recommend good resources to help me get started?
0
votes
1
answer
1k
views
Xpath to an anchor returning error: unable to locate element
I am new to automated testing. I am using C#, Selenium and Chrome 99 with the correct driver. I am trying to get to an anchor tag on the page.
Here is my code that is not working,
driver.Url = "...
2
votes
2
answers
56
views
Can tests written in Visual Studio / Selenium / Nunit be made available to non technical QA folks?
We have a few QA folks that do not code. I am writing test cases in VS and was asked if there is a way to make them available to them. Maybe an .exe that lists all the test scenarios and they can ...
1
vote
1
answer
159
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
0
answers
347
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 ...
0
votes
1
answer
268
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
2
answers
2k
views
Methods to setup parallel test execution in NUnit with Selenium WebDriver C#
For true parallel execution of Selenium tests in NUnit, does the setup of the webdriver object need to be within the test method itself? Or is there a better way?
Previously, for parallel execution ...
1
vote
1
answer
2k
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....
0
votes
2
answers
314
views
Testing multiple browser configurations via Selenium WebDriver
When covering cross-browser testing using Selenium WebDriver, how do you provide the browser and version information to the tool (e.g. BrowserStack, Sauce Labs)? For example, you're wanting to execute ...
0
votes
1
answer
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;
...
2
votes
1
answer
48
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 ...
0
votes
4
answers
95
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
1
answer
831
views
How to generate report using extent reports in Page Object Model in C#
I have created a POM framework using NUnit in C#. I have created Reporting.cs file which creates reports for the test in that class. How I can generate reports for all tests in different classes ...
2
votes
2
answers
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 ...
0
votes
1
answer
60
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 ...
1
vote
1
answer
1k
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
1
answer
431
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 ...
0
votes
1
answer
1k
views
How can I use Sequential attribute with TestCaseSource in nUnit?
I'm new to unit testing and nUnit in general and I'm not sure what I'm trying to do is possible or if I'm using the right syntax (in C#).
I want to pass for a test a collection of IEnumerable using ...
2
votes
1
answer
2k
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 ...
0
votes
2
answers
618
views
Selenium, data driven testing using NUnit and SQL queries.
I am developing a Selenium Test Automation Framework for the purpose of testing multiple websites.
I have currently set up the Framework in Visual Studio using C# and implementing the Page Object ...
0
votes
1
answer
2k
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
1
answer
472
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 ...
0
votes
2
answers
1k
views
If an element id is present but still we are getting element not found exception, its reason? how to handle it [closed]
If an element id is present but still we are getting element not found exception, as its reason? how to handle it.
1
vote
1
answer
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
1
answer
251
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 ...
0
votes
1
answer
294
views
Selenium pytest vs nunit
I'from background of automated testing with tools like Testcomplete, QTP, JMeter and soupUI.
Recently there was a need automation of web-application for institute I work. I started with Selenium-...
2
votes
2
answers
309
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 ...
1
vote
1
answer
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 ...
2
votes
1
answer
4k
views
BDD specflow Error: "Ambiguous Step Definition Found For Step
I'm getting this error: Ambiguous Step Definition Found For Step.... on running my Specflow Test. The code is for the client, that I'm working for, thus I'm not permitted to provide code sample.
...
6
votes
2
answers
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.
1
vote
0
answers
315
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 ...
1
vote
1
answer
115
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 ...
2
votes
2
answers
7k
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 ...
6
votes
2
answers
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) ...
1
vote
3
answers
3k
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 ...
2
votes
1
answer
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
1
answer
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,...
0
votes
1
answer
5k
views
How to run a NUnit test using cmd
I created a simple test suite using NUnit by opening a new .Net console application project.
In the Visual Studio at Test explorer I can see my test methods.
Now I want to run them using CMD, i.e. at ...
0
votes
1
answer
601
views
TestCase Filter in TFSBuild
I am using Nunit V2.6.4 and NunitTestAdapter v2.0 to run selenium tests in visual studio 2015. We also have a build definition set up to run these tests nightly(on selenium grid)in chrome browser. I ...
2
votes
1
answer
8k
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
1
answer
912
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 ...
0
votes
1
answer
1k
views
webdriver doesnt Click (sometimes) even after waiting for ElementToBeClickable
Example not exact code:
WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(45));
wait.Until(ExpectedConditions.ElementIsVisible(By.Id(Element)));
wait.Until(ExpectedConditions....
1
vote
2
answers
618
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 ...
0
votes
3
answers
1k
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
2
answers
2k
views
Inconsistent behaviour of Click() in Selenium
I'm working on a Product automation(Web CMS), where element.Click() shows the inconsistent behaviour. Basically we are using, Selenium + Nunit GUI(unit testing framework) - To run the test cases from ...
3
votes
1
answer
995
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 ...
2
votes
2
answers
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 ...
5
votes
3
answers
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 ...
1
vote
1
answer
3k
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 ...
2
votes
1
answer
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 ...