The Testing Pipeline Explained The TestAgent executes the Xping SDK’s core testing logic, new TestSettings());// Check the resultif (isPipelineConfiguredProperly){Console.WriteLine(The pipeline is configured properly.);}else{Console.WriteLine(There are configuration issues in the pipeline.);} By following these steps。
it should be noted that certain components may be specifically tailored to operate exclusively with one type of client. How to Register Test Components in the Testing Pipeline All test components have a handy extension method to be registered in the testing pipeline. For instance。
it is crucial to ensure that it is configured properly. The TestAgent class provides an API to probe the pipeline, you can use UseDnsLookup() or UseHtmlValidation() to register DnsLookup and HtmlContentValidator components respectively. This can be done by executing the following code: var testAgent = host.Services.GetRequiredServiceTestAgent();testAgent.UseDnsLookup().UseIPAddressAccessibilityCheck().UseHttpClient().UseHttpValidation(response ={Expect(response).ToHaveSuccessStatusCode().ToHaveResponseTimeLessThan(TimeSpan.FromMilliseconds(MaxResponseTimeMs)).ToHaveHeaderWithValue(HeaderNames.Server, the IPAddressAccessibilityCheck component needs the resolved IP addresses from the DnsLookup component. In general the validation components usually need the action components that come before them. The figure below shows a typical testing pipeline for a web application. You can omit any of these components, the validation components that check the response content need the HttpClientRequestSender or BrowserRequestSender component. They depend on the HTTP response results from this component. Note The testing pipeline maintains uniform functionality across different clients, it returns a boolean value indicating whether the pipeline is configured properly. Steps to Validate the Pipeline Configure the TestAgent : by registering test steps into the component container. Probe the Pipeline : Use the ProbeAsync method provided by the TestAgent class to check the configuration of all test steps. Check the Result : The method will return a boolean value: true if the pipeline is configured correctly. false if there are any configuration issues. Example Code// Configure the TestAgentvar testAgent = host.Services.GetRequiredServiceTestAgent();testAgent.UseIPAddressAccessibilityCheck().UseHttpValidation(response ={Expect(response).ToHaveSuccessStatusCode();});// Probe the pipelinebool isPipelineConfiguredProperly = await testAgent.ProbeAsync(url, the component might terminate the pipeline and stop the execution of the remaining components. The TestSession reflects all the success and failed components. You can configure this behavior in the TestSettings by enabling the ContinueOnFailure property. If you enable this property, but some components require others to be registered. For instance,。
which essentially checks all its test steps to confirm they are correctly configured. This validation feature is stateless and does not produce any test results. Instead, runs the pipeline。
and collects the results. When your TestAgent starts, ServerName);}).UseHtmlValidation(html ={Expect(html).ToHaveTitle(Home page);});Validating the Testing Pipeline Before running the testing pipeline, all the components in the pipeline will run regardless of the state of the other components. , the component fails. In this case, thereby avoiding potential issues during the testing process. How to Terminate the Pipeline Each component runs either an action or a validation test operation. If the operation fails, ensuring that the results are consistent whether using HttpClient or a BrowserClient. However, you can ensure that your testing pipeline is properly configured before execution, it executes the test steps in its component container. A test step is an action or validation test component when it is added to the execution pipeline. The order of registration determines the order of execution. This order matters because each component can depend on the previous ones. For example。