Testing Tools
The frameworks you actually write tests with, from JVM unit runners and mocking libraries to browser E2E drivers and load generators across Python, Node, Ruby, PHP, .NET, and native stacks. Interviewers use this area to see whether you pick the right tool for a test level instead of forcing everything through one framework.
on this pageshowhide
explore
- JUnit191 questions
- Test Annotations22 questions
- Assertions & Assumptions27 questions
- Lifecycle & Fixtures18 questions
- Parameterized Tests27 questions
- Extension Model28 questions
- Test Runners & Suites20 questions
- Nested & Dynamic Tests15 questions
- Tags, Conditions & Parallelism19 questions
- JUnit Platform15 questions
- TestNG40 questions
- @Test Settings5 questions
- Configuration Hook Order5 questions
- Groups & Dependencies5 questions
- @DataProvider & @Factory5 questions
- Suite File & Thread Modes5 questions
- Listeners & Retry5 questions
- Hard and Soft Asserts5 questions
- Choosing a JVM Runner5 questions
- Mockito114 questions
- Mocks, Spies & Injection19 questions
- Stubbing23 questions
- Matchers & Captors16 questions
- Verification17 questions
- Advanced Mocking23 questions
- Strictness & Mocking Hygiene16 questions
- pytestempty
- Fixtures and Scopesempty
- Parametrizationempty
- Plugins and Mockingempty
- Jest36 questions
- Test Structure and Matchers6 questions
- Mocks and Spies6 questions
- Async Testing6 questions
- Snapshot Testing6 questions
- Setup and Configuration6 questions
- Coverage6 questions
- Vitest6 questions
- Jasmineempty
- RSpec23 questions
- Example Groups & Hooks5 questions
- Expectations & Matchers6 questions
- Doubles & Message Stubs6 questions
- Run Order & Filtering6 questions
- Minitest14 questions
- Assertions & Spec DSL5 questions
- Mock Verification & Stubbing4 questions
- Runner, Plugins & Parallelism5 questions
- PHPUnit20 questions
- Test Cases & Assertions5 questions
- Data Providers & Attributes5 questions
- Mocks & Stubs5 questions
- Configuration & Coverage5 questions
- Pest12 questions
- Closure Tests & Expectations6 questions
- Architecture & Plugins6 questions
- xUnit15 questions
- Facts & Theories5 questions
- Class & Collection Fixtures5 questions
- Version 3 Changes5 questions
- NUnit11 questions
- Attributes & Constraints6 questions
- Parallel Runs & Fixture Lifetime5 questions
- MSTest12 questions
- Attributes & Data Rows6 questions
- SDK & Test Platform6 questions
- GoogleTest21 questions
- Assertions and Death Tests5 questions
- Fixtures and Value Parameters5 questions
- GoogleMock Expectations6 questions
- Test Runner Flags5 questions
- Catch217 questions
- Sections and BDD Macros6 questions
- REQUIRE and CHECK5 questions
- Generators and Library Setup6 questions
- ScalaTestempty
- Cypress (has its own guide)256 questions
- Test Runner and Commands44 questions
- Selectors and Assertions29 questions
- Network Stubbing and Intercept25 questions
- Fixtures and Custom Commands25 questions
- Component Harness20 questions
- Pipeline Orchestration25 questions
- In-Browser Runtime30 questions
- Config and Node Events20 questions
- Debugging and Diagnostics21 questions
- Choosing and Moving17 questions
- Playwright (has its own guide)287 questions
- Browsers and Contexts36 questions
- Locators and Auto-Waiting59 questions
- Assertions29 questions
- Fixtures and Test Config41 questions
- Network Interception32 questions
- Tracing and Debugging24 questions
- Run Orchestration33 questions
- Isolated Component Runs14 questions
- Positioning and Migration19 questions
- Selenium (has its own guide)265 questions
- WebDriver Architecture40 questions
- Element Location32 questions
- Synchronization Model31 questions
- Element Interaction36 questions
- Browser Context Control24 questions
- Screenshots and Logs16 questions
- Abstraction Layers20 questions
- Grid Deployment28 questions
- Suite Execution16 questions
- Ecosystem and Positioning22 questions
- Puppeteerempty
- Webdriver.ioempty
- Nightwatchempty
- JMeter (has its own guide)246 questions
- Plan Composition26 questions
- Load Shaping29 questions
- Dynamic Values26 questions
- Sample Verdicts22 questions
- Run Output27 questions
- Headless Execution27 questions
- Multi-Engine Runs20 questions
- Custom Behaviour23 questions
- Protocol Coverage30 questions
- Pipeline Fit16 questions
- k6 (has its own guide)161 questions
- Verdict Gating27 questions
- Executor Choice17 questions
- Script Anatomy25 questions
- Declared Settings16 questions
- Metric Model15 questions
- Transport Surface15 questions
- Measurement Delivery13 questions
- Runtime and Extension19 questions
- Automation Fit14 questions
- Gatling111 questions
- Injection Vocabulary30 questions
- Chained Builders26 questions
- Session Values23 questions
- Finished Simulation16 questions
- Ecosystem Placement16 questions
- Locustempty
- Lighthouseempty
- Chrome DevTools18 questions
- Sources Panel Breakpoints6 questions
- Source Maps, Overrides, Console6 questions
- Network Panel Diagnosis6 questions
- REST Assured (has its own guide)133 questions
- Request DSL & Assertions6 questions
- Outgoing Call Setup18 questions
- Specification Reuse20 questions
- Response Consumption27 questions
- Payload Binding15 questions
- Credential Wiring16 questions
- Cross-Cutting Hooks15 questions
- Harness Placement16 questions
- Kotest108 questions
- Spec Styles16 questions
- Matchers & Assertions19 questions
- Property-Based Testing20 questions
- Data-Driven Testing9 questions
- Lifecycle & Configuration29 questions
- Platform & Ecosystem Integrations15 questions
- MockK92 questions
- Mocks, Spies and Lifecycle18 questions
- Stubbing14 questions
- Matchers and Capture17 questions
- Verification16 questions
- Mocking Kotlin Constructs13 questions
- Coroutines, Annotations and JUnit 514 questions
- Contract Testing29 questions
- Contract Testing Fundamentals4 questions
- Pact Consumer Tests4 questions
- Pact Provider Verification4 questions
- Pact Broker and can-i-deploy5 questions
- Spring Cloud Contract4 questions
- Message and Event Contracts4 questions
- Schema Evolution and Compatibility Gates4 questions
- Cucumber & BDD Automation43 questions
- Gherkin Syntax & Feature Files4 questions
- Scenario Outlines & Data Tables5 questions
- Step Definitions & Expressions5 questions
- Hooks, Tags & Execution Control5 questions
- State Sharing & Dependency Injection4 questions
- Cucumber-JVM & Runner Integration6 questions
- cucumber-js, Behave & SpecFlow/Reqnroll5 questions
- Reporting & Living Documentation5 questions
- Scenario Design & Anti-Patterns4 questions
- Testcontainers31 questions
- Core API and Lifecycle4 questions
- Module Containers5 questions
- Spring Boot Integration3 questions
- Networking and Wait Strategies4 questions
- Reuse and Performance5 questions
- Custom Images and Compose5 questions
- CI and Docker Environments5 questions
- Test Management & Reporting185 questions
- Case Inventories90 questions
- Result Consolidation95 questions
- API Mocking & Stub Servers (has its own guide)110 questions
- Stand-In Definitions31 questions
- Lifecycle and Isolation32 questions
- Transport Conditions22 questions
- Fidelity Risks25 questions
- Browser & Device Clouds85 questions
- Sourcing the Fleet13 questions
- Remote Session Wiring24 questions
- Capacity and Cost16 questions
- Triaging from Afar16 questions
- Access and Data Trust16 questions
- Karate (has its own guide)90 questions
- Glue-Free Execution13 questions
- Payload Matching29 questions
- Reuse and Defaults21 questions
- Mock Mode16 questions
- Adoption and Wiring11 questions
- API Testingskill
- ASP.NET Coretool
- Android Developerrole
- Apache JMetertool
- C#skill
- C++skill
- Cucumbertool
- Cypresstool
- Gatlingtool
- Grafana k6tool
- JS Full Stack Developerrole
- JUnittool
- Java Backend Developerrole
- Java SDETrole
- JavaScriptskill
- Karatetool
- Kotesttool
- Kotlin Backend Developerrole
- Laraveltool
- MockKtool
- Mockitotool
- PHPskill
- Playwrighttool
- QA Engineerrole
- REST Assuredtool
- Rubyskill
- Ruby on Railstool
- Seleniumtool
- Symfonytool
- Testcontainerstool
questions
2 782 · 31 sectionsIn JUnit 5, some teams mark tests with one custom annotation such as @SlowIntegrationTest instead of writing @Test plus @Tag("slow") on every method. What is that custom annotation called, and how does JUnit know to treat the method as a test?
basics
~20 sIt is a composed annotation: your own annotation type that is itself annotated with JUnit's @Test, @Tag, @ExtendWith and so on. Jupiter looks up annotations recursively, so anything meta-annotated with @Test is discovered and run as a test.
In JUnit 5, what does the @Disabled annotation do, how does putting it on a test class differ from putting it on a single test method, and what is the string argument used for?
basics
~20 s@Disabled skips a test instead of running it, reporting it as skipped rather than failed. On a method it skips that method; on a class it skips every test in the class, including its nested classes. The string argument is the reason, shown in reports and IDEs.
What rules must a Java method (and its enclosing class) satisfy for the JUnit 5 Jupiter engine to discover and run it as a test?
basics
~20 sAnnotate it with org.junit.jupiter.api.Test. The method must not be private, static or abstract, and must return void. Parameters are allowed only if a ParameterResolver supplies them (TestInfo, TestReporter, @TempDir...). The class must not be abstract and needs a single constructor; neither class nor method has to be public.
In JUnit 5, how do you make a single test fail automatically if it runs longer than a chosen duration, and what exactly happens when that limit is reached?
basics
~20 sAnnotate the test with JUnit Jupiter's @Timeout, e.g. @Timeout(value = 500, unit = TimeUnit.MILLISECONDS). The default unit is seconds. When the limit elapses the test fails with a TimeoutException naming the method and the configured duration.
In JUnit 5, how do you make a test stop at runtime and report itself as skipped when a precondition is not satisfied, and how does that outcome differ from a failure?
basics
~20 sCall Assumptions.assumeTrue(condition) (or assumeFalse) at the top of the test. If the condition does not hold, a TestAbortedException is thrown, the rest of the method never runs, and the test is reported as aborted or skipped — the build stays green rather than red.
In TestNG, how does a hard assert from org.testng.Assert differ from a SoftAssert, and when should you use each?
basics
~20 sA hard assert from org.testng.Assert throws an AssertionError at the first failed check and ends the test method. A SoftAssert records each failure and keeps going; only its assertAll() call throws, listing every recorded failure.
In TestNG, in what order do the @BeforeSuite, @BeforeTest, @BeforeClass and @BeforeMethod hooks and their @After pairs run?
basics
~10 sTestNG nests its hooks from widest to narrowest: @BeforeSuite, @BeforeTest (once per <test> element of testng.xml), @BeforeClass, @BeforeMethod, then the test method; the @After hooks unwind in reverse, @AfterMethod first and @AfterSuite last.
In TestNG, how does a @DataProvider method feed rows of arguments into a @Test method, and which return types may it use?
basics
~10 sA @DataProvider method returns rows of arguments, and every @Test method naming it in its dataProvider attribute runs once per row. Accepted return types are Object[][], Iterator<Object[]>, Object[] and Iterator<Object>.
In TestNG, how do you tag test methods with groups and then run only one group, such as smoke, from testng.xml or the command line?
basics
~20 sAdd groups = {"smoke"} to @Test, then select it with <groups><run><include name="smoke"/></run></groups> in testng.xml or -groups smoke on TestNG's command line. Group names match as regular expressions, and an excluded group beats an included one.
In TestNG, which listener interfaces fire around a suite, a <test> element and a single test method, and how do you register one?
basics
~10 sTestNG's ISuiteListener wraps each suite, ITestListener wraps each <test> element and reports every test method's pass, failure or skip, and IInvokedMethodListener wraps every invocation. Register them with @Listeners, testng.xml's <listeners>, -listener or ServiceLoader.
In a Mockito test, what value comes back when you call a method on a mock that you never stubbed, and what part of Mockito decides that value?
basics
~10 sThe mock's default answer decides. Mockito's built-in default, Answers.RETURNS_DEFAULTS, gives 0 for numeric primitives, false for boolean, an empty collection, Optional or Stream for those types, and null for every other object. Nothing throws.
When writing Mockito stubs and verifications, when should you wrap a plain value in ArgumentMatchers.eq(), and when is passing the raw value directly the better style?
basics
~20 sUse eq() only when the same call already uses another matcher, because matchers and raw values cannot be mixed. If no argument needs a wildcard, pass plain values - eq() everywhere is noise with identical behaviour.
Explain what Mockito's ArgumentCaptor is for, how you create one and wire it into a verification, and how you read the captured value afterwards.
basics
~10 sAn ArgumentCaptor grabs the actual argument a mock received so you can assert on it. Create it with ArgumentCaptor.forClass(X.class) or @Captor, pass captor.capture() inside verify(...), then read captor.getValue() and assert normally.
In Mockito, what is an argument matcher such as any(), anyString() or anyInt(), and why would you stub or verify a call with one instead of passing a concrete expected value?
basics
~20 sA matcher is a placeholder used inside Mockito's when() or verify() saying 'any argument fitting this description' instead of one exact value. any() matches anything, anyString() any non-null String, anyInt() any int. Use them when the value is irrelevant or unpredictable.
You create a Mockito mock of a Java interface and then call a method on it that you never stubbed. What does that call return, and what else happens?
basics
~20 sNo real code runs. Mockito returns the type's default value: null for objects, 0 for numbers, false for boolean, and an empty collection, Optional or stream for those types. Void methods do nothing. The call is recorded so you can verify it later.
In a Jest 30 test, why must you return or await the promise under test, and what happens when you forget?
basics
~20 sJest 30 waits only for a promise the test function hands back: returned, or awaited inside an async test. Forget that and Jest stops waiting when the function returns, so the assertion's outcome no longer decides the test.
How do you turn on code coverage in a Jest 30 run, and what does Jest write out by default?
basics
~10 sRun jest --coverage or set collectCoverage: true. Jest then prints a per-file text table and writes clover, json and lcov reports, the lcov one including an HTML site, into a coverage folder under rootDir.
In Jest 30, what does a jest.fn() mock function record about its calls, and which matchers read that record back?
basics
~20 sA jest.fn() mock records every call on its mock property: arguments in mock.calls, outcomes in mock.results, plus this values and instances. Matchers such as toHaveBeenCalledTimes and toHaveBeenCalledWith read that record; Jest 30 removed aliases like toBeCalled.
In Jest 30, what is the default testEnvironment, and what do you change so a React component test can use document?
basics
~10 sJest 30 defaults testEnvironment to node, so document and window do not exist. Install jest-environment-jsdom, then set testEnvironment: 'jsdom' in the config or add a @jest-environment jsdom docblock to that test file.
In Jest 30, where does toMatchSnapshot store a snapshot, and how is each entry in that file named and matched?
basics
~20 stoMatchSnapshot serializes the value and stores it in snapshots/<test file>.snap beside the test, keyed by the full test name plus a counter; every later run serializes again and compares against the entry under that same key.
What is Vitest, and why does a project already built with Vite usually choose it as its test runner?
basics
~20 sVitest is a Vite-powered test runner: it reuses the app's vite.config and plugins, runs ESM and TypeScript without a separate transformer, offers a Jest-compatible API through vi and expect, and re-runs only affected tests in watch mode.
In Vitest 5, why does a vi.mock factory that reads a top-level const fail with 'Cannot access before initialization', and how does vi.hoisted fix it?
basics
~20 sVitest hoists vi.mock above the imports, so its factory runs when the mocked module is first imported, before the file's top-level const lines run. vi.hoisted creates those values in a block hoisted with it, so the factory can read them.
In Vitest 5, how do you run some tests in the node environment and others in jsdom or happy-dom, per file or per package?
basics
~20 sVitest 5 defaults to the node environment. One file opts into jsdom or happy-dom with a // @vitest-environment comment at its top; a whole package gets its own environment as an entry in test.projects, which replaced test.workspace.
A test ported from Jest 30 to Vitest 5 defers a callback with process.nextTick, calls vi.runAllTicks() under fake timers, and now fails with zero calls. Why, and how do you fix it?
basics
~20 sjest.useFakeTimers() fakes process.nextTick, so jest.runAllTicks() drained it. vi.useFakeTimers() leaves nextTick real, so vi.runAllTicks() finds nothing and the synchronous expect runs first. Await a real tick before asserting, or add 'nextTick' to toFake under the threads pool.
After a Jest suite moves to Vitest 5, why do call counts reset between tests and mockReset stop blanking mocks, and what breaks?
basics
~20 sVitest 5 turns clearMocks on by default, wiping call history before every test, and its mockReset returns a mock to the implementation it was created with, where Jest's installs an empty function. Cross-test call assertions and reset-then-undefined expectations break.
In rspec-mocks, what is the difference between allow(obj).to receive(:msg) and expect(obj).to receive(:msg)?
basics
~20 sallow(obj).to receive(:msg) permits a message and configures its reply; the example passes whether or not it is sent. expect(obj).to receive(:msg) also demands it: unless it arrives exactly once by the end of the example, the example fails.
In an RSpec spec, how do describe, context and it relate to each other, and what does nesting groups actually build?
basics
~20 sdescribe and context both create an example group and behave identically; it defines one example in a group. A nested group is a subclass of its parent, inheriting let, hooks and helpers, and each example runs in a fresh group instance.
In RSpec, how do the eq, eql, equal and be matchers differ when a spec checks an order total or an order object?
basics
~20 seq passes when actual == expected, eql when actual.eql?(expected), and equal or be(x) only when both are the same object (equal?). Bare be with no argument passes for any truthy value. eq is the default for values.
In an RSpec spec, how does instance_double differ from a plain double, and what does it check against the real class?
basics
~20 sA plain double accepts stubs for any method name, so it stays green when the real class changes. instance_double(SmsGateway) only lets you stub or expect instance methods SmsGateway really defines, and checks calls against their parameters.
In RSpec, how do let, let! and an instance variable assigned in a before hook differ in when setup runs?
basics
~20 slet is lazy, running its block on first call and memoizing the value for one example. let! also adds a before hook, so it always runs. An instance variable set in before always runs too, and reads as nil if misspelled.
With Minitest, what makes a method in a Minitest::Test subclass run as a test, and when do setup and teardown run?
basics
~10 sMinitest runs every public method whose name starts with test_ in a Minitest::Test subclass, each on a fresh instance. setup runs before every test and teardown after it, even when the test failed.
With Minitest 6, how do you run one test file, one test method, or only the tests matching a pattern?
basics
~20 sRun the file with ruby -Ilib:test, and filter tests with --include (alias -n) using a name or a /regexp/, or --exclude. Under rake use N=, X= or A=; Minitest 6's minitest command also accepts file.rb:line.
With Minitest, how does assert_raises decide whether a test passes, what does it return, and how do you check the error message?
basics
~10 sassert_raises(ErrorClass) { code } passes when the block raises that class or a subclass, and returns the exception so you can assert on its message. No exception, or a different one, fails the test.
With minitest-mock, how do Minitest::Mock#expect and #verify work, and what happens when code calls the mock differently than expected?
basics
~20 sexpect(name, retval, args) records one expected call and its return value; each actual call consumes one expectation. verify raises MockExpectationError for any expected call that never happened; unexpected arguments raise it at call time, unknown methods raise NoMethodError.
With minitest-mock, how does Object#stub replace Time.now for one block in a subscription-renewal test, and what restores the original?
basics
~20 sTime.stub(:now, fixed_time) { ... } redefines now on Time's singleton class for the length of the block, returning fixed_time or calling it if it is callable; an ensure clause restores the original method even if the block fails.
In a PHPUnit 13 phpunit.xml, what do the <testsuites> element, the bootstrap attribute and the <source> element each configure?
basics
~10 s<testsuites> names sets of test directories or files; bootstrap names a PHP script, usually vendor/autoload.php, included once before tests load; <source> declares your first-party code, which coverage and issue reporting are scoped to.
With a PHPUnit 13 test stub, how do you make a method return a value, choose one by argument, compute one, or throw?
basics
~10 sName the method with method(), then attach an answer: willReturn() for fixed values, willReturnMap() to pick by arguments, willReturnCallback() to compute from them, and willThrowException() to throw.
With PHPUnit, what is the difference between assertSame and assertEquals, and when does choosing the wrong one hide a bug?
basics
~20 sassertSame checks identity with ===: same type and value, and for objects the same instance. assertEquals checks loose equality: 90 equals '90', and separate objects with equal properties are equal. Loose checks can pass when the type is wrong.
In PHPUnit 13, how does a #[DataProvider] method feed a test, and why must that provider be public and static?
basics
~20 s#[DataProvider('name')] points a test at a public static method returning an iterable of argument arrays. PHPUnit calls it while building the suite, before any setUp(), so there is no instance to call it on; each array becomes one test run.
In PHPUnit 13, what is the difference between createStub() and createMock(), and how do you choose between them?
basics
~20 screateStub() returns a Stub that only answers calls with configured values; createMock() returns a MockObject that can also carry expects() rules that PHPUnit enforces. Stub collaborators that feed data in, mock those whose calls are the outcome.
In Pest, how do expect()->toBe() and toEqual() differ, and how do the not and and() modifiers change an expectation chain?
basics
~20 stoBe() checks type and value and, for objects, the same instance; toEqual() checks equal value loosely, so '1' equals 1 and two equal objects pass. not inverts only the next expectation, and and() starts a new expectation on another value.
In a Pest test closure, what is $this, how does beforeEach() share state through it, and what does pest()->extend()->in() change?
basics
~20 s$this is the PHPUnit test case instance the closure is bound to, a fresh one per test. beforeEach() stores state on it, such as $this->cart. pest()->extend(Base::class)->in('Feature') makes tests in that folder bind to your base class instead.
In Pest, how do test() and it() differ, and what does describe() add to the tests declared inside it?
basics
~20 stest() and it() both register one test from a description and a closure; it() only prefixes the description with 'it'. describe() groups tests under a shared name prefix and scopes the hooks and datasets declared inside it to that group.
In Pest, how would you write an arch() test that forbids controllers from using the database layer directly?
basics
~10 sWrite arch()->expect('App\Http\Controllers')->not->toUse([...]) naming the database namespace and classes such as PDO, or turn it around with arch()->expect('App\Database')->toOnlyBeUsedIn('App\Repositories'); Pest fails the test listing every file that breaks the rule.
What do Pest's --parallel and --tia options each do to a slow suite, and why does only one belong in the CI command?
basics
~20 s--parallel runs the whole suite across several processes through ParaTest, so it belongs in CI; --tia (Pest 5) records which files each test touches and later runs only affected tests, replaying cached results, so it is meant for local runs.
In xUnit.net, what is the difference between [Fact] and [Theory], and how does [InlineData] supply a theory's test cases?
basics
~20 s[Fact] marks a parameterless test that must always pass; [Theory] marks a parameterised test that must hold for every data row. Each [InlineData(...)] supplies one row of constant arguments, and xUnit.net runs and reports the method once per row.
In xUnit.net, why do you put per-test setup in the test class constructor and teardown in Dispose instead of attributes?
basics
~20 sxUnit.net creates a new instance of the test class for every test, including each theory row, so the constructor is per-test setup and Dispose or DisposeAsync is per-test teardown. Instance fields start fresh for every test without any attributes.
In xUnit.net, how does IClassFixture<T> share an expensive search index across one test class's tests, and when is it created and disposed?
basics
~20 sMark the test class with IClassFixture<SearchIndexFixture> and take SearchIndexFixture in its constructor. xUnit.net builds the fixture once, before the class's first test, passes that same instance to every test's fresh class instance, and disposes it after the class's last test.
Why is an xunit.v3 test project built as an executable, and which packages and project settings does it need?
basics
~20 sIn xunit.v3 every test project is its own runnable program: the package generates an entry point and the build fails unless OutputType is Exe. Reference xunit.v3, which brings Microsoft.Testing.Platform v2, or xunit.v3.mtp-off when the project must run on VSTest only.
In xUnit.net, how do you assert that code throws, and how do Assert.Throws, Assert.ThrowsAny and Assert.ThrowsAsync differ?
basics
~10 sWrap the call in a lambda: Assert.Throws<T> passes only for exactly T, Assert.ThrowsAny<T> also accepts derived exceptions, and Assert.ThrowsAsync<T> handles Task-returning code and must be awaited. Each returns the caught exception for further asserts.
In NUnit 5, what is the difference between [SetUp] and [OneTimeSetUp], and when does each one run?
basics
~10 sIn NUnit, [SetUp] runs before every test in a fixture and [TearDown] after each one; [OneTimeSetUp] runs once before the fixture's first test and [OneTimeTearDown] once after its last, for expensive shared resources.
In NUnit 5, how does [TestCase] parameterise a test, and what do ExpectedResult and NUnit's argument conversion add?
basics
~20 s[TestCase] supplies one row of constant arguments per attribute; NUnit turns each row into its own test. ExpectedResult lets the method return the value NUnit compares, and NUnit converts literals such as 0.5 into decimal parameters.
In NUnit 5, why is Assert.That with Is, Has, Does and Throws the primary assertion model, and where did Assert.AreEqual go?
basics
~20 sNUnit's constraint model puts every check behind Assert.That(actual, constraint), with constraints built from Is, Has, Does and Throws that compose and explain failures. NUnit 4 moved classic asserts to ClassicAssert; NUnit 5 adds C# 14 extensions forwarding Assert.AreEqual to it.
In NUnit 5, do tests run in parallel by default, and what do [Parallelizable] and its ParallelScope values change?
basics
~20 sNo. NUnit runs tests one at a time until [Parallelizable] opts them in. The attribute defaults to ParallelScope.Self; Children lets a fixture's tests run concurrently, Fixtures lets fixtures run alongside each other, and All is Self plus Children.
In NUnit 5, what are TestContext.Out, TestContext.Progress and TestContext.CurrentContext for, especially when tests run in parallel?
basics
~20 sTestContext.Out writes to the current test's own output, TestContext.Progress writes immediate progress messages, and TestContext.CurrentContext describes the running test: name, properties, arguments, result. Each follows the test's own execution context, so parallel tests do not mix.
In MSTest 4, how do [TestClass], [TestMethod] and [DataRow] turn one method into several test cases?
basics
~20 s[TestClass] marks a public class whose public [TestMethod] methods MSTest discovers. Each [DataRow] on a test method supplies one argument list, and MSTest runs the method once per row as a separate test case with its own result.
In MSTest 4, why did [ExpectedException] give way to Assert.Throws and Assert.ThrowsExactly, and how do the two differ?
basics
~20 s[ExpectedException] passed when any line of the test threw, so it could hide bugs, and MSTest 4 removed it. Assert.Throws<T> wraps only the call under test and accepts T or a subclass; Assert.ThrowsExactly<T> requires exactly T. Both return the exception.
In MSTest 4, how do [Parallelize] and [DoNotParallelize] control parallel test runs inside one assembly, and what are their defaults?
basics
~20 sMSTest runs an assembly's tests sequentially by default. [assembly: Parallelize] turns parallelism on, with Workers = 0 (logical processor count) and Scope = ExecutionScope.ClassLevel by default; [DoNotParallelize] opts an assembly, class or method back out.
How does running MSTest 4 tests on Microsoft.Testing.Platform differ from running them on VSTest?
basics
~20 sVSTest loads a test library into its own testhost through vstest.console and discovered adapters. Microsoft.Testing.Platform compiles the framework and its extensions into the test project, which runs as an executable and accepts only the options its referenced extensions provide.
In MSTest 4, what does a test project built on MSTest.Sdk set up for you that a Microsoft.NET.Sdk project with MSTest packages does not?
basics
~20 sMSTest.Sdk is a project SDK layered on Microsoft.NET.Sdk: it references the MSTest framework and adapter at one version, makes the project a Microsoft.Testing.Platform executable (UseVSTest defaults to false) and adds TRX and coverage extensions through a profile.
In GoogleTest, what is the difference between ASSERT_EQ and EXPECT_EQ, and when should a test use each?
basics
~20 sEXPECT_EQ records a non-fatal failure and the function keeps running, so one run reports every mismatch. ASSERT_EQ records a fatal failure and returns from the current function; use it when the following lines depend on the check.
In GoogleTest, how does TEST_F differ from TEST, and does each TEST_F get its own fixture object?
basics
~20 sTEST_F's first argument is a fixture class derived from testing::Test, and the test body can use its members. GoogleTest builds a fresh fixture object for every TEST_F and destroys it afterwards, so nothing stored in its members carries over.
What does linking GoogleTest's gtest_main library give a test binary, and what must a hand-written main() do instead?
basics
~20 sgtest_main supplies a main() that calls testing::InitGoogleTest(&argc, argv) and returns RUN_ALL_TESTS(). A hand-written main must do the same: initialise first so --gtest_* flags are parsed, then return RUN_ALL_TESTS()'s result so failures reach the exit code.
In GoogleTest, how do TEST_P and INSTANTIATE_TEST_SUITE_P run one test body over many values, and how are the generated tests named?
basics
~20 sA fixture derived from testing::TestWithParam<T> holds the TEST_P bodies, which read GetParam(). INSTANTIATE_TEST_SUITE_P supplies values from a generator such as Values or Combine, and each value becomes a test named Prefix/Suite.Test/index unless a name generator supplies the suffix.
In GoogleMock, how do you declare a mock method with MOCK_METHOD and set an expectation on it with EXPECT_CALL?
basics
~20 sMOCK_METHOD(ReturnType, Name, (Args...), (Specs...)) in a public section generates the mock member. EXPECT_CALL(mock, Name(matchers...)) then states, before the code runs, which calls must happen, how often, and what they return; unmet expectations fail when the mock is destroyed.
In Catch2, what is the difference between REQUIRE and CHECK when the asserted expression is false?
basics
~20 sBoth record a failure and fail the test case. REQUIRE then aborts the current run, while CHECK continues so later assertions still report. Use REQUIRE where later code depends on the condition and CHECK for independent facts.
In Catch2, what do the name and tags arguments of TEST_CASE do, and how do tags decide which tests run?
basics
~20 sTEST_CASE takes a free-form quoted name and an optional string of bracketed tags such as "[stack][fast]". Name plus tags must be unique in the binary; tags group cases for selection, and a [.] tag hides one from the default run.
In Catch2 3, how do you compare a computed double against an expected value, and when do WithinRel and WithinAbs differ?
basics
~20 sUse REQUIRE_THAT with Catch::Matchers::WithinRel or WithinAbs instead of ==. WithinRel scales its tolerance with the values' magnitude, defaulting to 100 machine epsilons; WithinAbs uses a fixed margin, which is what works when the expected value is zero.
In Catch2, how does a TEST_CASE containing several SECTIONs execute, and why does each section start from fresh setup?
basics
~20 sCatch2 runs a TEST_CASE once per leaf SECTION, each time from the top. Each run repeats the setup and enters exactly one leaf, so every section sees freshly built locals; a parent section is entered once per leaf beneath it.
How do you run only some Catch2 tests from the command line and write JUnit XML for CI in the same run?
basics
~20 sPass a test spec, such as a name, "area*" or "[geometry]~[slow]", to the test binary, and choose reporters with -r. Since Catch2 3.0.1, several can run at once: -r console -r junit::out=results.xml writes readable output and a JUnit file.
Which browsers can Cypress 16 launch, and how do you pick one for a run?
basics
~20 sCypress 16 launches Chrome-family browsers - Chrome, Chrome for Testing, Chromium and Edge - plus Firefox, experimental WebKit, and the deprecated bundled Electron. Choose one per run with the --browser flag, or set defaultBrowser in the Cypress config.
In Cypress, how do you test a link that opens in a new browser tab?
basics
~20 sCypress drives a single tab and has no tab-switching command, so assert the link rather than follow it: check its href and target attributes, request the URL directly with cy.request, or strip the target attribute so the click navigates the current tab.
Why does a console.log() in a Cypress spec never reach the terminal running cypress run?
basics
~20 sSpec code is evaluated inside the browser, so console.log() writes to that browser's DevTools console. The terminal belongs to Cypress's separate Node process, which only prints what code in cypress.config.js and its Node handlers log.
In Cypress, what happens to a request whose host matches a `blockHosts` pattern?
basics
~10 sCypress ends the request itself and answers 503, adding an x-cypress-matched-blocked-host header naming the pattern that matched. The request is never sent, so it resolves immediately instead of waiting on a third party.
In Playwright, what does expect(locator).toMatchAriaSnapshot() compare, and what does it ignore?
basics
~20 sIt compares an element's accessibility tree, meaning the roles, accessible names and a few ARIA states of its non-hidden nodes, against a YAML template. It ignores pixels, CSS, tag names, class names and hidden nodes.
In Playwright, what happens the first time expect(page).toHaveScreenshot() runs and no reference image exists?
basics
~20 sPlaywright captures the page, writes that capture to the snapshots folder as the new reference image, and still fails the test. A later run, or an automatic retry, compares against the file just written and passes.
In Playwright, what does expect.soft() do that a plain expect() does not?
basics
~10 sA soft assertion records its failure and lets the test keep running, while a plain expect throws and stops the test at that line. Both end with the test reported as failed.
In Playwright, what happens if you forget to await expect(locator).toBeVisible()?
basics
~20 sPlaywright's web-first matchers return a promise. Without await, the test body runs on and the test finishes before the matcher decides anything, so the assertion can never fail it — the error is dropped or blamed on a later test.
In Selenium, how do you read a JavaScript confirm dialog's text and then accept or cancel it?
basics
~10 sTake the dialog with driver.switchTo().alert(), which returns an Alert. Call getText() for its message, then accept() to press OK or dismiss() to press Cancel. Use sendKeys only on a prompt, before accepting it.
In Selenium, which Chrome preferences make a download land in a directory your test picked, with no save prompt?
basics
~20 sSet the Chrome preference download.default_directory to an absolute path and download.prompt_for_download to false, passed as the prefs experimental option on ChromeOptions. The browser then writes the file into that folder on whichever machine runs the browser.
Where does Selenium Manager store the drivers it downloads, and does every Selenium 4 run download again?
basics
~20 sIn a per-user cache folder, by default ~/.cache/selenium, and no. Selenium 4's Selenium Manager reuses a matching cached driver on later runs and downloads only when the cache has no suitable copy. SE_CACHE_PATH moves the folder.
In Selenium 4, what happens when you construct a ChromeDriver without configuring any chromedriver path?
basics
~20 sSelenium Manager runs automatically. The binary bundled in the Selenium 4 client detects the installed Chrome, works out the matching chromedriver, downloads it if the local cache lacks it, and returns the path, so the session starts with no PATH entry and no setup code.
In JMeter's CSV Data Set Config, what happens if you leave Variable Names empty?
basics
~20 sJMeter reads the file's first line and uses its fields as the variable names. That line is consumed as a header, never handed to a thread as data, and the Delimiter field must match the header's separator.
In JMeter, how do you write a call to a built-in function such as __UUID?
basics
~10 sJMeter function calls take the form ${__functionName(arg1,arg2)}. The double underscore marks a built-in, the parentheses hold comma-separated positional arguments, and a function that takes none may drop them: ${__UUID}.
In JMeter's Regular Expression Extractor, what does a Template value of $1$ refer to?
basics
~20 sTemplate $1$ inserts the text captured by the first parenthesised group of the Regular Expression field. JMeter builds the stored value from the Template, so $0$ means the whole match and $1$ the first group.
In Apache JMeter, how do you capture an order id from a JSON confirmation body for the next request?
basics
~20 sAdd a JSON Extractor as a child of the sampler that returns the confirmation body, give it a variable name and a JSON Path expression, then reference the captured value as ${orderId} in the next request.
In JMeter, what is the difference in scope between a variable and a property?
basics
~10 sA JMeter variable is a per-thread copy that no other thread can read or change. A JMeter property is a single JVM-wide value that every thread in the run shares.
In a k6 `constant-arrival-rate` scenario, what do the `rate`, `timeUnit` and `duration` keys each set?
basics
~10 sIn k6 v2, rate is how many iterations the executor starts during each timeUnit period, timeUnit is that period (default 1s), and duration is how long the scenario keeps starting them.
Which k6 scenario do the root vus and iterations options build, and what does duration do there?
basics
~20 sk6 turns root vus and iterations into a single scenario named default that uses the shared-iterations executor, so iterations is the total across all VUs. A root duration set alongside them becomes that scenario's maxDuration.
In k6, how do the constant-vus and ramping-vus executors differ, and what options does each take?
basics
~20 sk6's constant-vus executor holds a fixed number of VUs for a set time and takes vus plus duration. ramping-vus moves the count through a schedule and takes startVUs, stages and gracefulRampDown. Neither accepts the other's keys.
In a k6 arrival-rate scenario, what do preAllocatedVUs and maxVUs control, and what happens when maxVUs is omitted?
basics
~10 spreAllocatedVUs is the number of VUs k6 initializes before an arrival-rate scenario starts; maxVUs is the hard ceiling that pool may grow to mid-run. Omitted, maxVUs equals preAllocatedVUs, so the pool never grows.
Which of k6's four metric types does each built-in such as vus, http_reqs or checks use?
basics
~20 sk6 has four metric types: Counter, Gauge, Rate and Trend. Among the built-ins, vus and vus_max are Gauges, http_reqs and iterations are Counters, checks and http_req_failed are Rates, and every duration such as http_req_duration is a Trend.
Which command launches a Gatling simulation under Maven, Gradle, sbt and the JavaScript CLI, and how do the four names differ?
basics
~20 sMaven runs mvn gatling:test, Gradle runs ./gradlew gatlingRun, sbt runs sbt Gatling/testOnly with a class pattern, and the JavaScript CLI runs npx gatling run. Each build tool names its own entry point; there is no shared Gatling command.
In Gatling, how do you assemble a browse-then-checkout scenario out of two reusable chain values?
basics
~20 sStore each flow in a chain value returned by a standalone exec call, then hand both to scenario("Shopper").exec(browse, checkout). Chains are ordinary values, so one scenario composes as many of them as you like, in order.
In a Gatling scenario, how do you repeat a chain a fixed number of times or for a fixed duration, and how do the Java and Scala spellings of those loops differ?
basics
~10 srepeat(n) runs the wrapped chain n times; during(d) runs it until d has elapsed. Java, Kotlin and JavaScript attach the body with .on(...), while Scala passes it in a second parameter list.
In Gatling, what must a Java or Kotlin simulation declare before its first request — which class does it extend, and which imports put the DSL in scope?
basics
~10 sA Gatling simulation in Java or Kotlin extends io.gatling.javaapi.core.Simulation and needs two imports per DSL family: the package wildcard for the types, plus a static import of CoreDsl and HttpDsl for the DSL methods.
Which npm packages does a Gatling HTTP simulation written in JavaScript or TypeScript depend on, and which of them provides the gatling command-line tool?
basics
~10 sThree: @gatling.io/core for the DSL and the simulation function, @gatling.io/http for the HTTP protocol builder, and @gatling.io/cli, a dev dependency that supplies the gatling command you invoke as npx gatling.
In Chrome DevTools, how do you pause a script at a chosen line, then step over, into and out of its calls?
basics
~20 sOpen the Sources panel, click a line number to set a breakpoint, and trigger the code. Execution pauses before that line; Step over runs a call whole, Step into enters it, and Step out finishes the current function.
In the Chrome DevTools Network panel, how do you find one failing API call among hundreds of requests and see what it sent and received?
basics
~20 sOpen DevTools before triggering the call, click the Fetch/XHR type filter, narrow with terms such as status-code:500 or method:POST, tick Keep log if the page navigates, then click the row and read Headers, Payload and Response.
In the Chrome DevTools Sources panel, what changes once a source map loads for a minified bundle, and which code actually runs?
basics
~20 sChrome still runs the minified bundle. A loaded source map only changes what DevTools shows: original files appear in Sources, and breakpoints, errors, logs and Call Stack frames are translated to original files and lines.
In the Chrome DevTools Timing tab for a request, what does each main phase mean and what does a long one point to?
basics
~20 sQueueing and Stalled mean the browser held the request back; DNS lookup, Initial connection and SSL mean connection setup; Waiting for server response means server time plus a round trip; Content download means reading the body.
In Chrome DevTools, how do you find the code behind a checkout button that sometimes does nothing, in a large bundled application you did not write?
basics
~20 sDo not read the bundle: make the symptom pause you. Use an Event Listener Breakpoint on click, an XHR/fetch breakpoint on the request URL, a DOM change breakpoint on the button and Pause on caught exceptions, then read the Call Stack.
In REST Assured, how do you authenticate every request by default and opt one test out?
basics
~10 sAssign a scheme to the static field RestAssured.authentication, for example RestAssured.basic(user, pass). It applies to any request that sets no scheme of its own. A single request opts out with given().auth().none().
In REST Assured, how do you carry a logged-in session id from one request to the next?
basics
~20 sRead the session id off the login response with sessionId(), then hand it to the next call as given().sessionId(value). REST Assured writes it as the JSESSIONID cookie. One SessionFilter instance added to both requests does that capture-and-replay for you automatically.
REST Assured has no auth().bearer() method - so how do you attach a bearer token to a request?
basics
~20 sUse given().auth().oauth2(token) - REST Assured has no bearer method at all. With the default HEADER signature that call installs a PreemptiveOAuth2HeaderScheme, which writes a plain Authorization: Bearer header on the request, with no signing and no challenge round trip.
What is the REST Assured library used for on the JVM, and how does its given/when/then request DSL work?
basics
~20 sREST Assured is a Java library for testing HTTP/REST APIs. You write one fluent chain: given() sets up the request (headers, body, params, auth), when() fires the HTTP call (get/post/put/delete), then() asserts on the response (status, headers, body values).
In REST Assured, how do you print the request and response only when a validation fails?
basics
~20 sREST Assured buffers the log instead of printing it when you chain given().log().ifValidationFails() on the request or then().log().ifValidationFails() on the response. The buffered text reaches the console only if a then() expectation fails. RestAssured.enableLoggingOfRequestAndResponseIfValidationFails() switches both sides on globally.
In a Kotest spec, how do you run setup code before every test and cleanup code after every test, and what do those callbacks receive?
basics
~20 sDeclare Kotest's beforeTest { } and afterTest { } blocks in the spec body. beforeTest receives the TestCase about to run; afterTest receives a TestCase/TestResult pair. Both are suspend lambdas, so suspending setup and cleanup work directly.
When a Kotest table-driven check (`forAll` over a `table(headers(...), row(...), ...)`) fails on some rows, do the remaining rows still run, and what does the resulting failure message contain?
basics
~20 sEvery row runs. Kotest collects the failures instead of stopping at the first one and then throws a single error that lists each failing row with its header/value pairs and that row's assertion error, so you see all bad rows in one run.
When you drive tests from a collection of values with Kotest's `withData`, how does the framework derive the name of each generated test, and what happens when the elements are not data classes?
basics
~20 sKotest asks the element for a stable identifier: a WithDataTestName implementation wins, then an @IsStableType-annotated class's toString, then a data class's toString. Anything else falls back to a type-derived name, so every case ends up named the same.
In Kotest, test bodies and lifecycle callbacks are declared as suspending functions. What does the framework do differently because of that, and what does it change about how you write a test that touches suspending code?
basics
~20 sKotest invokes every test body — and every lifecycle callback like beforeTest and beforeSpec — inside a coroutine, so suspending calls are made directly with no wrapper builder. The test scope is itself a CoroutineScope, and Kotest enforces the test's configured timeout around that coroutine.
A developer puts JUnit 5 annotations like @BeforeEach, @Disabled and @Tag inside a Kotest FunSpec and nothing happens — no setup runs, the "disabled" test still executes. Why are they inert, and what are the Kotest-side equivalents?
basics
~20 sKotest specs are executed by Kotest's own TestEngine, not JUnit Jupiter, and Jupiter annotations only mean something to the Jupiter engine. Use Kotest's own facilities instead: beforeTest/afterTest/beforeSpec, .config(enabled = false) or the x-prefixed builders, @Ignored on the spec, and Kotest Tag objects.
In a test class that declares MockK's @MockK and @SpyK properties, what does MockKAnnotations.init(this) actually do, and what breaks if you forget to call it?
basics
~20 sIt reflects over the given instance, creates a mock or spy for every MockK-annotated property and assigns it. Without it those lateinit properties are never set, so the first use throws UninitializedPropertyAccessException — the annotations do nothing on their own.
In a JUnit 5 test class annotated with @ExtendWith(MockKExtension::class), what work does MockK's extension actually perform, and at which points of the test lifecycle does it perform it?
basics
~20 sIt initialises annotated mock properties on each new test instance, resolves MockK-annotated test parameters, and afterwards runs unmockkAll() plus clearAllMocks() — after every test method, or after the whole class when the instance lifecycle is PER_CLASS.
After calling MockK's mockkConstructor(Foo::class), what does anyConstructed<Foo>() actually stand for, and which Foo instances does a stub recorded on it affect?
basics
~20 sanyConstructed<Foo>() is not an instance — it is a single shared handler for the class. Every Foo constructed while the class is mocked routes its calls through it, so one stub applies to all of them. Methods you never stub fall through to the real implementation.
When you call MockK's mockkObject(PricingRules) on a Kotlin object declaration, is a new instance created to stand in for the singleton, and what happens when the test then calls a method you never stubbed?
basics
~20 sNo new instance: MockK patches the existing singleton in place, so its identity and state are unchanged and every holder of a reference sees the patch. Unstubbed methods still run the real implementation — an object mock is a spy, not a strict mock.
When you use MockK's mockkStatic to stub a Kotlin top-level or extension function, how do you work out the exact string to pass, and what can change that name?
basics
~20 sPass the JVM name of the file facade class: package plus source file name with Kt appended. Greetings.kt in com.acme becomes com.acme.GreetingsKt. A @file:JvmName annotation on that file replaces the name, and the string must match exactly.
In Pact, Spring Cloud Contract and bi-directional contract testing, who authors the contract artefact first, and who must act when verification fails?
basics
~20 sPact is consumer-driven: the consumer records a pact file and the provider must satisfy it. Spring Cloud Contract is producer-first: the provider authors the contract and ships stubs. Bi-directional cross-checks a provider specification against consumer-recorded expectations, coupling the teams least.
In Pact, what does an asynchronous message pact verify, and what does excluding the transport leave unproven?
basics
~20 sAn asynchronous Pact message pact verifies that a producer emits a payload the named consumer's handler can decode. It covers payload shape and message metadata only. Topic, broker, delivery and serialization on the wire stay unproven.
What does the Pact Broker store that a shared folder of pact files cannot?
basics
~20 sThe Pact Broker stores pacts as a relation: each pact belongs to a named application and a specific version, and each verification result is recorded against that pact and the provider version that ran it. A folder stores only bytes.
What does a Pact consumer test do at runtime, and when does it write the pact file?
basics
~20 sA Pact consumer test starts a local mock HTTP server, registers the expected interactions on it, and runs the real client code against that server. The pact JSON file is written only when every registered interaction was requested and matched.
How does a Pact provider verification run fetch pacts and replay each interaction?
basics
~20 sA Pact verification run loads pact files from a broker, a URL or a local folder, then per interaction applies the provider state, sends the recorded request to the running provider, and matches the real response against the recorded expectations.
In a Cucumber .feature file, which lines does the Gherkin parser treat as keywords, and what happens to a line that matches none?
basics
~20 sGherkin recognises a fixed keyword set - Feature, Rule, Background, Scenario, Scenario Outline, Examples and the Given/When/Then/And/But step keywords. Other text is free-form description where the grammar allows it, and a parse error that fails the whole file anywhere else.
What does Cucumber's tag expression "@smoke and not @wip" select, and which lines can carry those tags?
basics
~20 sIt selects scenarios tagged @smoke that are not also tagged @wip. Cucumber tag expressions are boolean, with lowercase and, or, not and parentheses. Tags written on Feature, Rule, Scenario, Scenario Outline and Examples lines are inherited downward.
In Cucumber-JVM, what does the glue option point at, and what happens when it is wrong?
basics
~20 sThe glue option lists package names that Cucumber scans recursively for step definitions and hooks — packages, never file paths. Point it at the wrong package and every step of every scenario reports undefined, not just one line.
In a Cucumber Scenario Outline, where does an <placeholder> from an Examples row get substituted?
basics
~20 sCucumber substitutes an Examples value into the Scenario Outline's name, into step text, into the cells of a data table attached to a step, and into a doc-string body. Tags, comments and Background are never templated.
In Cucumber, how do you select a formatter and point it at an output file, and which built-in formats are machine-facing?
basics
~20 sCucumber-JVM registers a formatter with --plugin name:path or the cucumber.plugin property; cucumber-js uses --format name:path; Behave pairs --format with --outfile. Console and HTML output is written for people, while JSON, JUnit XML and message output is written for tools.
In Testcontainers, what do GenericContainer's withExposedPorts, withEnv and withCommand actually do?
basics
~20 sThey build the specification Testcontainers sends to Docker when the container is created: withExposedPorts marks container-internal ports to publish on random free host ports, withEnv sets environment variables, and withCommand overrides the image's default command.
In Testcontainers, what does PostgreSQLContainer give you that a plain GenericContainer does not?
basics
~20 sA module container ships the right image defaults, the environment wiring the image expects, a database-aware readiness check, and typed accessors — getJdbcUrl, getUsername, getPassword, getDatabaseName — that already contain the randomly mapped host port.
In Testcontainers, why must a test use getHost() and getMappedPort() instead of a fixed port?
basics
~20 sTestcontainers publishes each exposed container port on a random free port on the Docker host, so the number differs every run and cannot be hardcoded. getHost() matters too, because the daemon is not always on localhost.
How does Testcontainers locate a Docker daemon, and what does a CI runner need to provide?
basics
~20 sTestcontainers probes an ordered chain of client strategies at startup: the tc.host override, the DOCKER_HOST environment variable with its TLS settings, then the Unix socket at /var/run/docker.sock. A CI runner needs one reachable Docker endpoint, not Docker Desktop.
In Testcontainers, why does PostgreSQLContainer reject an image named registry.corp/pg:16?
basics
~10 sModule containers assert that the image name matches the one they were written for. Wrap a mirrored image with DockerImageName.parse(name).asCompatibleSubstituteFor("postgres") to declare it behaves like upstream, and construction succeeds.
In a TestRail-class test management product, what does assigning a test cycle item to a named tester change, and what does that tester's queue show?
basics
~20 sAssignment records an owner on one cycle item, so it leaves the shared pile and appears in that tester's filtered queue. It changes nobody's result: an assigned item stays untested until an outcome is recorded.
In a TestRail-class case repository, a requirement-coverage panel reports a single percentage — what sits in the numerator and what forms the denominator?
basics
~20 sThe denominator is the set of requirements the panel's saved filter selects; the numerator is how many of those satisfy the panel's configured covered condition. The unit counted is the requirement, not the test case.
In a TestRail- or Xray-class test case repository, what does attaching a variant table to one stored case do, and how does a placeholder in a step get its value?
basics
~20 sA variant table holds one row of values per run of the same stored case. Placeholders in the step text name a column, and the repository substitutes that row's value, producing one execution per row.
Before a TestRail-class case repository can create a defect in a separate issue tracker, what must the two systems agree on about the destination?
basics
~20 sTwo things, as a pair: which tracker project receives the item, and which item type it is created as. Trackers attach mandatory fields, closed value lists and workflow to that pair, so the mapping is defined against it.
In a TestRail-class case repository, what does filing a defect straight from a failed execution pre-fill into the new tracker item?
basics
~20 sFiling from a failed execution pre-fills the draft ticket with the run's context: which case failed, which cycle it ran in, the environment or build under test, who recorded the result, and the comment and evidence captured at failure time.
In MockServer, how do you verify that a POST to /catalogue/v1/holds actually arrived?
basics
~20 sMockServer keeps a journal of every request it receives, and MockServerClient.verify asserts against it. Pass a request definition describing the POST plus a VerificationTimes count. When nothing matches, verify throws an AssertionError listing the requests the journal did record.
In WireMock, what does the --no-request-journal flag switch off, and what then happens to verify()?
basics
~20 sWireMock's --no-request-journal flag stops the server recording the requests it receives. Because nothing is recorded, verification is not weakened but abolished: the disabled journal raises RequestJournalDisabledException. A verify() call after that flag can never pass, whatever the client sent.
In WireMock, what does makeStubsPersistent(false) change about the stubs a re-recording produces?
basics
~20 sWith makeStubsPersistent set to false, WireMock keeps the regenerated stubs in memory only: they serve requests while the instance lives and vanish on restart. Its default, true, writes each one as a JSON file under the mappings directory.
In WireMock, what do GET, POST and DELETE on /__admin/mappings each do?
basics
~20 sWireMock's admin API at /__admin/mappings lists every registered stub on GET and registers one new stub from the posted body on POST. DELETE on the same path removes all of them. Any HTTP client can drive it while the server runs.
What is a hosted mock service, and what does a team give up by adopting it?
basics
~20 sA hosted mock service is a stub server a vendor runs for you. Its canned replies live in an account on their platform, reachable at an address they control. What you give up is custody: review, rollback and availability.
Who records the video of a hosted browser session, and what must your test do to get it?
basics
~20 sThe service makes the recording on its own machine: a capture process beside the browser grabs the virtual screen for the whole session. A test asks with one setting in the session request and fetches the finished file afterwards.
Does raising a test runner's worker count raise a hosted provider's session ceiling?
basics
~20 sNo. The worker count is a local setting that decides how many sessions your suite tries to hold at once; the ceiling belongs to the provider account and is enforced there, whatever your runner is configured to do.
Why do a hosted browser provider's settings arrive as one colon-prefixed capability map?
basics
~20 sW3C WebDriver reserves the colon for extension capabilities, so a provider's settings must sit under prefixed keys; gathering them into a single map is convention, not a rule. Loose non-standard keys are not capabilities the specification recognises at all.
Which of your hostnames does a hosted browser provider's tunnel carry, and what happens to the rest?
basics
~20 sA tunnel carries traffic for a defined set of names; anything outside that set the remote browser fetches the ordinary way. The danger is silence: an unlisted internal name can resolve publicly and the test passes against the wrong site.
In Selenoid, what is created when a browser session starts and what happens to it at the end?
basics
~20 sSelenoid starts a fresh Docker container per WebDriver session, proxies the session to the driver inside, then force-removes it on delete. Nothing carries over: no profile, cookies, downloads or stray process, unless browsers.json mounts a host directory in.
In a Karate feature file, what does `match response contains { id: 1 }` assert, and what does `match response.ids contains 23` assert when `ids` is a JSON array?
basics
~20 sKarate's contains asserts a subset. Against a JSON object, every expected key must exist with an equal value while extra actual keys are ignored. Against a JSON array, every expected item must appear somewhere, in any order.
In a Karate feature file, what does the step `* match order == { id: 1, name: 'Billie' }` assert, and what happens if `order` also carries a `role` key?
basics
~20 sKarate's match == compares the entire payload in one recursive step: every key and value must correspond exactly. An extra role key fails the step, because == is a strict whole-payload comparison, not a subset check.
In a Karate feature file, what forms can the left-hand side of a `match` step take, and what does a bare `$` refer to there?
basics
~20 sThe left side of a Karate match step is a variable name, a JsonPath or XPath rooted at a variable such as response.name, a function or method call, or parenthesised JavaScript. A bare $ stands for the response, and a left side that starts with / is a bare XPath rooted there too.
In a Karate feature file, the response carries a server-generated `id` and a `createdAt` timestamp that differ on every run. How do you still assert the entire payload in a single `match` step?
basics
~20 sPut marker strings where the unpredictable values would go: match response == { id: '#uuid', createdAt: '#string', name: 'Billie' }. A marker asserts the value's type or shape instead of its content, so one step still checks every key.
In a Karate feature file, what does the expected value `'#? _ > 0'` assert inside a `match`, and what is `_` bound to while that expression runs?
basics
~20 s#? runs the JavaScript that follows it and passes only when the result is true. Karate binds _ to the actual value at that position, so '#? _ > 0' asserts that the value there is greater than zero.