I have recently started writing Selenium tests on C#. Some test setups create users calling API before interaction with UI. Implementing security requirements developer added a request verification token as a parameter into API model.
Now, creating a user I must pass this parameter.
How do I do it without interaction with UI?
Asked
Active
Viewed 585 times
0

KoBe Brajantas
- 45
- 4
-
Ask how the token is generated and create a method to generate this token and update your calls to use it in the request. Try few things and post the code that has issue, also make sure you are not posting secret info like keys/passwords/salts. – lauda Sep 18 '17 at 10:30
-
Thank you @lauda. In my case Selenium runs on a separate solution, and I have no direct access to the code behind mentioned changes. I address all requests to application through a server and API calls. Pasting code in understandable output is complicated task since it involves subclasses and models spread across solution. – KoBe Brajantas Sep 18 '17 at 10:50
-
1If this token is generated by a dev from your team then you can ask for the logic of the token generation, else you would need to extract it using other means like from the response of some call. – lauda Sep 18 '17 at 11:21