Hi there,
I have a web application with some web pages and services behind the pages in the backend. The customer wants the product to have a screen connected to hardware and display the web pages, the requirements are met using Cog and a display connected to the HDMI interface.
However, testing is a challenge, usually I’d run tools such as Selenium or Playwright to confirm that the web pages are showing and behaving correctly which I can still do if I connect to the hardware with a web browser. My worry is that I encountered situations in the past where an application in PC had slightly different behaviour in Linux and with web browsers I feel that the issue may get a bit sticky…
So the question is, has anyone tried to test and measure the performance of web pages running Cog on iMx8?
Thanks.
OL
Hello @oscarins , welcome to the community 
A year ago we did some performance tests on Cog using an Apalis iMX8QM 4G 1.0B, running TorizonCore 5.6.0-devel-202202. The results were:
Canvasmark 2013 (score) → 4855
WebGL Benchmark (FPS) → 47
MotionMark 1.1 (score) → 1.38
WebGL Aquarium (FPS) → 27
BMark (score) → 126
HTML5Test (score) → 427
GUI Mark HTML4 (FPS) → 10
UI Layers (score) → 2
Bouncy Balls → success
Flappy Bird → success
Portainer → success
Grafana sample → success
Youtube video playback → success
Best regards,
Josep
Hello @oscarins ,
Did my answer help you to solve your issue? If so, could you please mark it a solution?
Best regards,
Josep
Hi @josep.tx thank you for the answer and sorry for the late reply. The information that you provided is very useful!
However, my question was really about running a tool to verify that Cog displays correctly my web page, the navigation is correct when clicking and I can get some measurement of loading times of pages, etc…
My thoughts were to use Selenium or Playwright but the support for Yocto and Cog seems quite limited.
The reason for this type of testing is that I’m finding situations where running a web application with Cog (or anything else) under different platforms can present different results and therefore complains from customers.
Thanks.
OL
Hello @oscarins ,
For Selenium you could try this:
but it’s been abandoned for a long time.
Best regards,
Josep
Hi @josep.tx , thank you for the information the link is very interesting, I’m going to try it.
I found strange that there is little information regarding this topic, I wonder if I’m barking at the wrong tree.
Thanks.
Oscar.
Hello @oscarins
I asked internally and apparently someone added support for it last year: https://github.com/Igalia/cog/pull/305, documented here: Cog – 0.0: WebDriver support.
And Apple et al even have some automated testing with it going on: Buildbot but a lot of the builds seem to be failing Buildbot.
Honestly, I’d only recommend Cog over Chromium if you really have a solid reason to choose Cog.
Would Chromium be an option for you?
One of our developers is working on automated browser testing and Cog is one of the browsers to test, but this will take a bit of time.
Please let us know about your findings 
Best regards,
Josep
Hi @josep.tx
The Cog WebDriver with Selenium works really well. It’s very easy to automate the screen navigation and measure screen loading times with Python.
One observation for any soul trying this approach, the example Connecting to the driver didn’t work for me, I had to change to the following:
options = webdriver.WPEWebKitOptions()
options.capabilities.clear() # Force to remove "version" and "platform" param from "alwaysMatch" list
options.binary_location = "/usr/bin/cog"
options.add_argument("--automation")
options.add_argument("--platform=wl")
driver = webdriver.Remote(
command_executor="http://YOUR_DEVICE_IP:8088",
options=options)
it seems that desired_capabilities argument isn’t available anymore.
Thanks.
Oscar
Hello @oscarins
Thank you very much for sharing the results of your tests with the community 
Best regards,
Josep