Execute a scenario test suite using OOTB REST service(/api/v1/testautomation/scenario and /api/v1/scenariotests/execute) and consume the response. We want to use it in test automation scripts.
Issue:
Tried running the above mentioned rest service(POST method by giving all the necessary parameters) rule by giving the scenario test suite pxInsName and expecting a response with pass fail information. But, Response body is empty and response code is http 200. Sample request below.
REST service is calling actvity pzExecuteScenarioTests which takes the above parameters and tries to get a ScenarioTestRunner and runs it. This code is neither giving exception nor executing the tests.
fetchedRunner is coming as false and
((com.pega.pegarules.priv.testautomation.IScenarioTestRunner)runner).runAll(); is not getting executed.
tried removing the if(fetechedRunner==true) check as well, still did not work.
When we use “Standalone” option, we must pass “ProviderURL” which is one of the inputs of the service as shown in picture that you shared above. This will be something like, “:/wd/hub”. Also, for browser and platform capabilities we pass the ones, that are supported by the standalone setup. To see this capabilities, first we can access “ProviderURL” from a browser, create a session from there, then check for the capabilities.
Also, make sure to pass pxInsName of the Test suite properly. You can find it by, opening the test suite, going to “Actions” menu, clicking on “View XML”, searching for “pxInsName”.
So even with standalone option, we need to give a selenium grid hub url in the provider url.
So does it mean in order to run the scenario test through REST api, we always need a third party provider(like selenium grid, CBT, etc)?
How is running the scenario test suite rule(from actions menu) different from executing it through REST service as it doesn’t require a third party provider.
For the first question (So does it mean in order to run the scenario test through REST api, we always need a third party provider(like selenium grid, CBT, etc)?), the answer is YES.
For the second question(How is running the scenario test suite rule(from actions menu) different from executing it through REST service as it doesn’t require a third party provider.), the answer is below..
When test cases are run from Test suite’s Actions menu (or in general, test case run from dev studio), the infrastructure to run the test cases is the OS on which we are working and, the browser using which we accessed our application. EX: Windows 10, chrome(installed version). Basically these UI based Scenario tests need some infrastructure to get executed on. This infra includes (OS, browser, desired screen resolution, etc..). So, when it comes to test case execution using REST service, it also needs some infrastructure to run our Scenario tests. To provide such infra there are tools available on web like, CrossBrowserTesting, BrowserStack, etc. So, providing the details of one such tools is required to run test cases using REST service.