Closed valdrinnz closed 4 years ago
Hello,
For this, I think you should try something along the line of checking the number of video elements on the page. I'm not sure about this syntax, I haven't use the Js API in a while:
let numberOfVideo = webdriver.findElements(By.tagName('video')).lenght();
and then use this numberOfVideo
instead of your numberOfParticipant
.
Let me know if it works 😄
No it doesn't work!
It doesn't work because you could get the number of video element on the page?
Did you get any error?
Is there any way to get the number of video feed you have? You can put a text displaying that on the page and get that by element.getText()
.
Is there an API on your web app that allow getting this number of participants by executing Js on the browser console? You can execute that with the webdriver's API to retrieve this value.
What else have you tried?
It is possible to write a script to check it dynamically, but I can't write the script for you. I can suggest some ideas, but if your only feed back is "it doesn't work" then I can't further develop these ideas.
closed till more info
Is possible with KITE to make Dynamic Received Video Check? We have a test case for monitoring videos, sometimes we need to monitor two feeds, sometimes three etc. Till now we can check videos by editing numberOfParticipants in config file. Is possible to write a script with KITE and check videos without editing the numberOfParticipants, knowing sometimes you have three feeds sometimes four feeds etc.
Our code looks like this: Config File:
"numberOfParticipant": 2,
ReceivedVideoCheck: `const {TestStep, KiteTestError, Status, TestUtils} = require('kite-common');/* / class ReceivedVideoCheck extends TestStep { constructor(kiteBaseTest) { super(); this.driver = kiteBaseTest.driver; this.timeout = kiteBaseTest.timeout; this.numberOfParticipant = kiteBaseTest.payload.numberOfParticipant; this.page = kiteBaseTest.page; this.takeScreenshot = kiteBaseTest.takeScreenshot; this.testReporter = kiteBaseTest.reporter; }
module.exports = ReceivedVideoCheck;
MainPage:
async videoCheck(stepInfo, index) { let checked; let i; let timeout = stepInfo.timeout; await TestUtils.waitForVideos(stepInfo, videos); checked = await verifyVideoDisplayByIndex(stepInfo.driver, index); while(checked.result === 'blank' && i < timeout) { checked = await verifyVideoDisplayByIndex(stepInfo.driver, index); i++; await waitAround(1000); } return checked.result; }async getVideos() { return videos; }`