-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Control() failed because of: Error: waitAsync is already running and cannot be called again at this moment #452
Comments
a for loop does not wait for an asynchronous operation to complete. so what you're seeing are the side effects of multiple async ops running in parallel. |
Hi @vobu , the error: is coming from statment: if I continue the debugging until the for loop: it will give another error, regards, |
of what type is the table that you're trying to call |
you're saying it is a |
it is sap.m.Table (import Table from 'sap/m/Table';) the selector is working fine: |
hm, all i can say about this from the distance is that we're extensively using tables/lists as well in our own tests, e.g.
does |
const items = [await tab.getItems(0) ]; is working without errors but getting errors afterwards with the following code: |
Then I'd suggest you try to debug each call as described in https://ui5-community.github.io/wdi5/#/debugging and check where the actual error occurs! |
Hi @vobu not sure if you get the notification for my last question, as the error is coming deep from WDI5, I need some insight where we can debug in the library, especially where the .sap.m.table code is located, to undestand what's going on |
What does not work is It seems wdi5 is triggering retrieving all items simultaneously from the browser, this function here is executed for each item before they are resolved: This seems to be prevented by the before if statement "if (bWaitStarted)": https://github.com/SAP/openui5/blob/251005d26646ef28e635e40819c94f14b433784a/src/sap.ui.core/src/sap/ui/test/autowaiter/_autoWaiterAsync.js#L37 |
woah, thanks for diving deep here @philippthiele 🤿 ! |
providing a PR: that's the spirit, yesss 🙌 |
Hello,
Describe the bug
We are getting error:
[wdi5] call of _getControl() failed because of: Error: waitAsync is already running and cannot be called again at this moment
[wdi5] error retrieving control: columnListItemId-__clone2
[wdi5] _asControl() needed 7.740290999412537 for columnListItemId-__clone2
After calling:
const tab = await browser.asControl({
forceSelect: true,
selector: {
id: "application-feature-display-component---FeatureList--featureListTableId",
interaction: "root" // <-- hooray!
}});
const items =await tab.getAggregation("items");
the first statement await browser.asControl is working fine,
The error is coming from the last statement of getting the items, and we have already a test scenario that is clicking on buttons which working fine, we have a problem only in getting the items of a list.
To Reproduce
You need to run the scenario we have, it will be not easy to share
Expected behavior
We are expecting the to get the items of table without errors, because we need for every item to extract some information about the rows , like text, statuses, .., this is not working:
const items =await tab.getAggregation("items");
Logs/Console Output
[wdi5] call of _getControl() failed because of: Error: waitAsync is already running and cannot be called again at this moment
[wdi5] error retrieving control: columnListItemId-__clone2
[wdi5] _asControl() needed 7.740290999412537 for columnListItemId-__clone2
Screenshots

Runtime Env (please complete the following information):
"@ui5/cli": "3.0.5",
"@wdio/cli": "7.20.9",
"@wdio/cucumber-framework": "7.20.8",
"@wdio/devtools-service": "7.20.9",
"@wdio/junit-reporter": "7.20.7",
"@wdio/local-runner": "7.20.9",
"@wdio/sauce-service": "7.20.9",
"@wdio/spec-reporter": "7.20.8",
"wdio-cucumber-reporter": "0.0.2",
"wdio-cucumberjs-json-reporter": "4.4.3",
"wdio-intercept-service": "4.2.2",
"wdio-ui5-service": "^1.3.2",
"wdi5": "^0.7.0",
Chrome
Version 112.0.5615.49 (Official Build) (arm64)
node --version
v16.19.1
MacOs:13.3.1 (22E261)
Additional context
We are also using OPAE2E also,
services: ['devtools', 'ui5', 'intercept', [ParallelTestService, {
rootDir: path.resolve(__dirname),
backendPath: backendPath,
dwcLocalConfigFile: './dwc-local-config.json',
maxParallelInstances: maxParallelInstances,
maxWaitForInstancesToStart: 200000,
skipInstrument: skipInstrument,
profile: 'default'
}], [pipelineUtilities.wdioAnalysePR, { repositoryName: "CALMBuild/cdm-features-ui" }]],
wdio.config:
....
wdi5: {
screenshotPath: require("path").join("some", "dir", "for", "screenshots"), // [optional] {string}, default: ""
screenshotsDisabled: false, // [optional] {boolean}, default: false; if set to true, screenshots won't be taken and not written to file system
logLevel: "verbose", // [optional] error | verbose | silent, default: "error"
skipInjectUI5OnStart: true, // [optional] {boolean}, default: false; true when UI5 is not on the start page, you need to later call .injectUI5() manually
waitForUI5Timeout: 15000 // [optional] {number}, default: 15000; maximum waiting time in milliseconds while checking for UI5 availability
},
The text was updated successfully, but these errors were encountered: