The common practice is to use an element’s ID to find the element. UI testing tools use either XPath or CSS selectors to interact with web page elements. There are a few nuances to keep in mind when testing the UI. Often that means the tests need to simulate clicking through the UI the same way users do in their web browser. In an ideal world, performance tests mimic real-world behavior. The response payload contains the key elements.To balance between correctness and speed, we recommend that API tests assert on: Having a large number of assertions can slow tests down and offset the actual measurements. To avoid false positives, use assertions to make sure that the system actually did what the test is expecting. Use data volumes that are the same order of magnitude as the production org. When conducting performance testing it’s recommended to use an org shape that is as close as possible to production. It’s what makes your org different from all the others. This refers to the type and amount of data in the org, the sharing rules, role hierarchies, territories, automations, and customizations. Use a realistic org shapeĪ Salesforce org can be referred to as having a “shape”. By using the same data set for all test runs, you can establish an apples-to-apples comparison. To accurately draw conclusions about how the system performs, you want to minimize the things that are changing between test cycles. It’s tempting to randomly generate data on the fly, but there are drawbacks to that approach. Performance tests often require data to be submitted as part of the test. It’s easier to update a single configuration file than hunt through all the tests to find where values are used. The details of where and what you’re testing may change frequently. Rather than hard code these data points, expose them as configuration options. To drive the tests, many things are required: URLs, URIs, and authentication information, for example. The tests should then use the access token in all additional API requests. The key point is that before the actual tests, the automation should negotiate logging in and fetching an access token. For more details on how to configure this, see the Salesforce documentation on authorization through connected apps and OAuth 2.0. In general, tests should leverage an OAuth flow that logs in with credentials and receives an access token. Because of this, there may be some nuance to how you implement authorizing your API calls in the tests. There are multiple authentication strategies that your Salesforce organization can use instead. The test measurements will be thrown off and the login security rules might lock the test user account for making too many login attempts. An easy mistake is to include the login flow as part of the test request. Don’t log in on every API requestĪPI requests must authenticate just like users do when accessing Salesforce. A good fit will enable working with all aspects of the message exchange such as response codes, headers, and the payload. Use tools that support HTTPs over TCP for API testing. Here are a few best practices for API related tests. Additionally, developers can create REST and SOAP APIs with custom Apex code. Salesforce provides multiple platform APIs such as the REST, SOAP, and Bulk APIs. Examples of this are LoadRunner, Selenium, and NeoLoad. Because of this, we recommend that you use tools that provide a full browser, DOM and CSS renderer for UI tests. It does this in part by fully utilizing the web browser’s capability. Salesforce Lightning provides a robust client-side experience. Consider adopting a specific tool for each group. In general, you can divide Salesforce test cases into two groups: UI tests and API tests. Some specialize on simulating user interface (UI) navigation, while others focus on sending messages that are of specific protocols, like HTTP requests over TCP. Performance testing tools tend to have a focus area. There are a few generalizations you can make to simplify things. The right answer for you depends on a host of factors: use cases, budget, available talent, time, and licensing and so on. The most common questions about performance testing are around selecting tools. In this article, we’ll focus on the nuances of performance testing solutions built on the Salesforce Lightning Platform. The first article provides a general introduction. This article is part two in a series on performance testing. We’re confident in our platform’s ability to scale and perform because we incorporate testing into our culture.ĭevelop a performance testing practice so you can be assured your solution will scale to meet your user needs without unwanted side effects. Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |