-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
call to get ui5 control is slow #196
Comments
Hi, first of all: thanks for providing detailed info and context: 👍 |
Hi, Just to illustrate the performance issue I am adding changes which helped me to track the slow but. As you can see waitForUI5 takes around 1.2 seconds. This is my changes to track time in getControl(): async function clientSide_getControl(controlSelector) {
controlSelector = await Promise.resolve(controlSelector) // to plug into fluent async api
return await browser.executeAsync((controlSelector, done) => {
const printTime = (message) => {
const d = new Date()
console.log(`${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}.${d.getMilliseconds()} -::- ${message}`)
}
const waitForUI5Options = Object.assign({}, window.wdi5.waitForUI5Options)
if (controlSelector.timeout) {
waitForUI5Options.timeout = controlSelector.timeout
}
printTime('Starting waitForUI5')
window.bridge
.waitForUI5(waitForUI5Options)
.then(() => {
printTime('Starting retrieving control')
window.wdi5.Log.info("[browser wdi5] locating " + JSON.stringify(controlSelector))
controlSelector.selector = window.wdi5.createMatcher(controlSelector.selector)
const element = window.bridge.findDOMElementByControlSelector(controlSelector)
printTime('Completed retrieving control')
return element
})
.then((domElement) => {
// window.wdi5.Log.info('[browser wdi5] control located! - Message: ' + JSON.stringify(domElement));
// ui5 control
printTime('Retrieving a control again')
const ui5Control = window.wdi5.getUI5CtlForWebObj(domElement)
printTime('Getting control id')
const id = ui5Control.getId()
printTime('Control id retrieved')
window.wdi5.Log.info(`[browser wdi5] control with id: ${id} located!`)
const aProtoFunctions = window.wdi5.retrieveControlMethods(ui5Control)
// @type [String, String?, String, "Array of Strings"]
done(["success", domElement, id, aProtoFunctions])
})
.catch((error) => {
window.wdi5.Log.error("[browser wdi5] ERR: ", error)
done(["error", error.toString()])
})
}, controlSelector)
}
module.exports = {
clientSide_getControl
} this is the console output:
|
Hi @edvardas-kireilis, first of all thanks for providing detailed info + context and for already digging quite deep 👍 |
Hi Volker. You are correct. We are starting using FLP and app tile. I would like to add that there seems to be a consistency with every browser.asControl() call. Thank you for you quick response. Looking forward to a resolution. |
Hi. Is there any update on the ideas to solve this issue? |
are you using |
As a side note: |
+1 - we've also seen that already and tracked it in #143 |
It seems that puppeteer is use by default, unless selenium driver is configured. exports.config = {
specs: [
'./test/wdi5/specs/**/*.spec.js'
],
exclude: [
],
maxInstances: 1,
capabilities: [{
maxInstances: 1,
browserName: 'chrome',
acceptInsecureCerts: false
}],
logLevel: 'warn',
bail: 0,
baseUrl: 'http://localhost:50001',
connectionRetryTimeout: 1000 * 60 * 30,
connectionRetryCount: 3,
services: [
'ui5',
['selenium-standalone', { drivers: { firefox: '0.29.1', chrome: true, chromiumedge: 'latest' } }]
// puppeteer is used if above is not added
],
framework: 'mocha',
reporters: [
'spec',
['junit', {
outputDir: './'
}]
],
//
// Options to be passed to Mocha.
// See the full list at http://mochajs.org/
mochaOpts: {
timeout: 1000 * 60 * 30
},
wdi5: {
screenshotPath: path.join(exports.getResultLocation(), 'screenshots'), // [optional] using the project root
screenshotsDisabled: false, // [optional] {Boolean}; if set to true screenshots won't be taken and not written to file system
logLevel: 'error', // [optional] error | verbose | silent
platform: 'browser',
url: '/flpSandbox.html#Shell-home',
deviceType: 'web', // [mandatory] native | web
skipInjectUI5OnStart: true,
waitForUI5Timeout: 1000 * 60 * 40 // [optional] maximum waiting time while checking for UI5 availability
}
} |
thanks for providing the config. We have up to date
in any of our test suites. |
PR to improve to fix this issue: But let's pause on pushing this change for a bit. |
Describe the bug
We started using wdi5 service in wdio tests and we noticed that it takes 1.2 or more second for any interaction with ui5 control to happen. I.e. to retrieve a proxy object of a Title or a Tile takes time. And after adding additional time logging I saw that most of the time is used waiting for sap.ui.test.RecordReplay.waitForUI5() function execution.
This ui5 library function is checking if all the waiters are not waiting. That includes promise waiter which gets two primises just before calling waitForUI5(). One promise comes from puppeteer library and another from the waitForUI5 method itself.
Few questions come to mind while investigating this slow performance:
Also I have switched from puppeteer to selenium driver and then only one promise was is _promiseWaiter object internal watch list. But that did not reduce delay of waitForUI5() execution.
To Reproduce
Call browser.asControl() to get a proxy object of any ui5 control. It should take around 1.2 seconds.
Expected behavior
I expect the control search to take 100ms or less.
The text was updated successfully, but these errors were encountered: