cancel
Showing results for 
Search instead for 
Did you mean: 

WDI5 Test in BAS ? onPrepare error

mayank_09
Discoverer
1,057

Hi All,

I am trying to create a wdi5 test case for an application developed in BAS. But after doing the initial config by using the npm init wdi5@latest -- --ts command and creating a test file in the test folder not able to run the application. in the debugger console, I am getting below error :

Request that anyone can help me in resolving this issue.

Regards:

Mayank Thakur

Accepted Solutions (0)

Answers (2)

Answers (2)

vladimirs_semikins
SAP Champion
SAP Champion

SAP Business Application Studio and SAP Build Code do not come with Chrome pre-installed, and it cannot be installed via the CLI. However, you can use Firefox, which will be installed once you add the "Headless Testing Framework." as an additional SAP Extension.

To do this, go to SAP Business Application dev space management. First, stop your development space and enter edit mode. You should see a screen similar to what is shown below. Select "Headless Testing Framework" and Save Changes. 

vladimirs_semikins_0-1729663523348.png

Now you need to configure WDI5 as per doc https://ui5-community.github.io/wdi5/#/usage?id=using-bas-with-wdi5

by the way, now you can also run UI5 Test Runner, too, to test:

Now you need to select 'Automation Library' which supports Firefox, e.g.

  • using selenium-webdriver run following in your terminal ui5-test-runner --browser $/selenium-webdriver.js -- --browser firefox
  • using webdriver.io run following in your terminalui5-test-runner --browser $/webdriverio.js -- --browser firefox

More about UI5 Test Runner - https://arnaudbuchholz.github.io/ui5-test-runner/

More about WDI5 and BAS https://github.com/ui5-community/wdi5/issues/329#issuecomment-1536121097 

 

AkhilDas
Explorer

HI mayank_09

I am still facing this issue as of October,2023.

Only work around I found was developing the same in vscode.

Thanks & Regards,

Akhil Das

sanjoy0308
Active Participant

Hi,

The Headless Testing Framework extension installs the Firefox browser which allows you to use the wdi5 capabilities when working in SAP Business Application Studio.. Please check here https://ui5-community.github.io/wdi5/#/usage?id=using-bas-with-wdi5

KR,

Sanjoy