Hot answers tagged

7

As a general rule of thumb, everytime a test fails or has an indeterminate outcome it requires investigation. If you ignore a failing/indeterminate test then you increase the risk of missing or overlooking a bug. The value of automation is to execute tests that we deem important enough that we want to run them repeatitively, or tests that are executed more ...


5

Yes, you can use NUnit for functional testing. But still it is a unit-testing framework. No, you are not creating unit-tests by using a unit-testing framework to write functional tests. A unit-test is testing just a single methods input and output, by writing end-2-end tests it by definition cannot be a unit-test. :) Unit testing frameworks are often ...


5

You can create an Even listener: EventListeners (NUnit 2.4.4) Interface The extension object passed to Install must implement the EventListener interface: public interface EventListener { void RunStarted( string name, int testCount ); void RunFinished( TestResult result ); void RunFinished( Exception exception ); void TestStarted(TestName ...


4

I've found that the deleteAllCookies function works differently in different browsers. DeleteAllCookies will delete all session data in Chrome, but only cookies in firefox. I'm still looking for a good way to delete session data in FF


4

In Java, you can delete all the cookies by calling driver.manage().deleteAllCookies().


4

Is it possible to wrap around Selenium 2.0 WebDriver Test Cases with anything other than NUnit for C# code? Yes. Extending the user246’s answer, Selenium is just a library that allows you to manipulate with web pages. Unit Test Framework wraps your tests and helps you to run the tests and produce the test execution report with number of passed/failed ...


4

Test automation is not high-end coding. You will not become wealthy doing either test automation or unit testing. Typically, unit-testing is not a separate job title. Experience with unit testing is more likely to lead to a career as a developer than Selenium automation. You are likely to make more money as a developer than as a tester.


3

I have a somewhat similar setup, however we decouple our non unit tests (Anything requiring an install to a server) from the typical unit tests which can run directly on the team city build server. In my solution we created a windows service polling team city for new builds via the rest API and when we find a new build we add it to the queue to execute our ...


3

Is NUnit a viable choice for a starting long term project these days? Yes because it is open source and even if there is no more further development for it you can use it and recomile it for a newer runtime. You can compare the maintanace situation with the log4net project that had very few updates in the last 5 years but is still the state of the art.


3

XPath list indexes are one-based, not zero-based. Try li[1].


3

it might help someone. As My mistake assuming that visual Nunit will show the test in test View but it will show tests by selecting View-> otherwindows-> Visual Nunit. Then It will display all your tests. Also If you want to see all you nunit tests in test View just like mstest then you have to install nunit for VS.


2

Can any one explain Assert.AreEqual(true, true) Verifies that two specified objects are equal. The assertion fails if the objects are not equal. Displays a message if the assertion fails. example and explanation? Very simple NUnit test: using System; using NUnit.Framework; namespace SampleUnitTest { [TestFixture] public Class SampleTest { ...


2

You can use Assertions to verify something is in a certain state. Normally you compare the actual against the excepted state. Example usage: Do some steps in your application Gather the value of a field Assert that the value is indeed the value you expect Assert.AreEqual(Actual, Expected) This could give an assertion failure if Actual and Expected ...


2

Are you using Visual Studio Express? If so, perhaps the workaround described in this SO thread will work for you: http://stackoverflow.com/questions/13348613/nunit-runners-via-nuget-on-visual-studio-2012-express-doesnt-work Edit: The selected answer, which reveals the limitation of Visual Studio Express + Nunit As I've found out Visual Studio Express does ...


2

After running my tests in NUnit GUI I can manually go into (Tools->Save Result as XML) then a file explorer is popped allowing me to select where the XML file is saved.


2

There is another tool to record page object model. below is the link: http://seleniumrecorder.blogspot.com/


2

I would always vote for hand-coding automated test over the use of Record and Playback. With programming test-cases its much easier to keep the tests DRY and if you think about maintainability of the tests up-front this will safe you a lot of time in the end. Some record and playback tools do support cutting up recordings in pieces and or replacing ...


2

Although I have never used them, it seems Unity released their own set of testing tools. See their introduction blogpost: http://blogs.unity3d.com/2013/12/18/unity-test-tools-released/ See their examples: http://blogs.unity3d.com/2014/05/21/unit-testing-part-1-unit-tests-by-the-book/ Get it from the Asset store: https://www.assetstore.unity3d.com/en/#!/...


2

You can run a single test from the command line using the nunit-console. Open command-prompt and change directory to the NUnit bin installation folder. To run a single test use: nunit-console /run:TestsToRun <path_to_dll> E.g. If your test has the following structure namespace TestsNamespace { public class TestsClass { //your tests ...


1

That was what I had previously believed also (because I've done dev) until my current position whereas the director is my source for this who actually sees the numbers. Although, maybe its more specialialist thing. You generally don't become wealthy as anyone's employee.


1

Is NUnit only a Unit testing framework? NUint is a .Net port (commonly used with Visual Studio) of JUnit (which is commonly used with Eclipse). So it's different than the standard 'unit tests' in a VS project. Generally those unit test are testing each function of the application. xUnit tests do test through the UI level. I think your hangup is on the term ...


1

Why not just place all the frame handles the driver currently has into a list then you will have all the window handles into a list and can target each individual one. Or use the findElements method, plural, since they all have the same id. public void navigateThroughMultipleIframes() { String parentWindow = driver.getWindowHandle(); Set<String&...


1

In NUnit 2.4.4, there is a new feature - the Suite Attribute that allows you to return an array of tests as opposed to using the TestSuite class in previous versions. To add tests, it would look something like this: [Suite] public static IEnumerable Suite { get { ArrayList suite = new ArrayList(); suite.Add(new AddAll()); return ...


1

Have you tried installing it using NuGet? Download and install NuGet. I recommend never installing any package without NuGet (unless absolutely neccecary, which is rare). It has a convenient plugin directly with Visual Studio (I assume you're using VS). Also you should make sure package restore during build is enabled in the project configuration (so you ...


1

We also have same issue in our production monitoring automation suite. To solve this problem to some extent, whenever a test is failed it is marked as INTERMITTENT and same test is repeated for max. 3 times or until it is passed. If it is getting passed in any one of next repetition then issue is left as Intermittent and not alerted. If it is failing all the ...


1

The EventListener is the way to go. However there is a knack: the UnhandledException will not be fired when an Assertion in your test fails. Rather use the TestFinished event to handle failed tests: public void TestFinished(TestResult result) { if (result.Executed && result.IsFailure) { Console.WriteLine(string.Format("Failure in ...


1

Typically people hook a continuous integration server up with selenium to provide a web interface. You can use Jenkins, it's open source, and can allow you to execute tests remotely, track success/failures, etc. Also try MbUnit/Gallio instead of nUnit, it provides a much more robust package to perform typical testing tasks, and includes better reporting ...


1

Selenium is just an API. You should be able to use it with any C# test framework.


1

Seems like I have to use this line of code before I invoke any click events. The "clickAndWait" conversion of the Selenium IDE to Webdriver doesn't seem to work properly. It converts everything to *.Click(). Adding the implicit wait after every click event and setting WAIT_TIME to 3 in my Constants class seems to do the trick. driver.FindElement(By....


1

A few things to look at. Are you sure that the LinkText is correct? Are you missing spaces, non breaking spaces, etc that may appear in the html but you don't see as a user? Are you sure the xpath is correct? Is this a timing issue? Are you trying to find the elements before the page is finished loading or before those elements are loaded?



Only top voted, non community-wiki answers of a minimum length are eligible