Вы находитесь на странице: 1из 8

03/27/2018

Updated: 03/11/2019
Synopsis: This document covers Performance
Testing workflow. How new test will be added in By: Ashish Kamble, Bentley Systems
the solution and how to run the tests through Inc.
various ways.
Scope: Asset Performance Testing and
Benchmarking

Asset Performance Testing


1. Overview
This document covers ALIM Performance Testing. How unit testing is integrated into the development
process and when and by whom tests are written. Refer to the training presentation.

2. Best Practices
 Utilize 3A’s (Arrange, Act, Assert where appropriate)
 Tests should be generically written to any customer environment.
 Use readable names for tests.
 If you find yourselves copying the same piece of code, refactor. Use OOP best practices.
 Tests should contain supporting data for them to function properly. A database project will
be provided to setup this data.

Page 1 of 8
03/27/2018

3. Writing New Test


Step 1: Navigate to the Alim_Performance_Application.sln located
$/Field/AssetWise/CONNECT_ALIM/Trunk/Automation Tests/HE Web Load Performance Tests

Step 2: Expand the HE Web Load Performance Tests project and open the settings.xml

Update the ALIMURL and User to reflect your local environment.

Tags of Data:

User :The user tag specify the user which will perform the tests. That tag contain username and
password which required for login the application to perform tests.

AlimUrl : This is the website link on which we have to perform performance test operations.

SearchAsset : This is for searching asset.

Step 3: Project Folder Dependencies

1) Automated generated folders

2) Webtest folder for commands (encode, decode)

3) Change content csharp project

Now,
1) Open Dumps folder

Page 2 of 8
03/27/2018

2) You can see list of tests


3) Open any test folder

4) You can see steps for that test


5) Open .saz archive step file
6) .saz files are Openable in fiddler mostly

7) Check each request carefully Now


8) Right window shows you request and response details at the time when recordings was
happening.
9) At Right Top Window, Select WebForms at Inspection check $filter, $select for any
numerical Id.
10) Same do with Right Bottom Window, choose Raw, keep checking for same numerical Id.
11) Keep note of it, would need handy in .webtest files (while adding extraction rule).
(e.g. ":{"instanceId":"1953","schemaName":") 1953 must be Id

Page 3 of 8
03/27/2018

12) Processing on webtest before using,


13) There will be some POST data encrypted which needs to decode.
14) Webtest folder having some commands like encode, decode are important before
searching and replacing the Ids.

15) To decode, open cmd, decode `filename`

16) Same for encode,

17) Open .webtest file in notepad++,


18) Search for 1953, replace with {{Id}} Same you need in VS Enterprise, extraction rule Id.
19) so run csharp project `ChangeContentOfWebtest.csproject`

Page 4 of 8
03/27/2018

20) option 1 for converting whole directory and 2 for specific file path, Open webtest folder
for the path

21) Here in example whole directory is selected.

22) All webtests are converted now.


23) Now open webtest folder copy all .webtest files.
24) Open visual studio Enterprise
25) Create folder with the test name
26) Paste all files in the folder

27) Now right click on specific request who needs to Extract Id


28) Add extraction rule, select extract Text, Put Starts with and Ends with.
29) Add new web performance test as parent test,

30) Add call to web test select your child tests

Page 5 of 8
03/27/2018

31) Then click on run test

32) Create new load test

33) Now you can run load test

Page 6 of 8
03/27/2018

5. Execution of Tests.
Build and Run your test.

6.Debugging
Like any C# application, you can debug your Alim_Performance_Application Tests. To do this, first build
the solution. Place your breakpoint somewhere in the test and then either from the Test Explorer or the
Class file start debugging the test. Refer to "5: Execution of Tests"

7.Report Generation
After successful completion of load test you can create Excel file for the load performance test.

Sample Report look like this:

References

 Plural Sight Training Materials


o https://app.pluralsight.com/library/courses/testing-automation-big-picture/table-of-
contents
 Other useful references
o https://martinfowler.com/articles/practical-test-pyramid.html#End-to-endTests

Page 7 of 8
03/27/2018

o https://stackoverflow.com/questions/22571267/how-to-verify-an-xpath-expression-in-
chrome-developers-tool-or-firefoxs-firebug/22571294
o http://innovativeteams.net/strategies-for-selenium-ui-testing/
o https://stackify.com/unit-testing-basics-best-practices/
o https://testing.googleblog.com/2015/04/just-say-no-to-more-end-to-end-tests.html
o https://github.com/nunit/nunit-csharp-samples

If you have any questions, please reach out to ashish.kamble@bentley.com,

Page 8 of 8

Вам также может понравиться