Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
SamLondon
Newbie

Roku WebDriver APIs (automated-channel-testing)

Here I would like to get the ball rolling on a discussion about the use of rokudev/automated-channel-testing suite as a template for creation of automated UI tests for Roku devices.

I have been trying to automate some test scenarios (user stories) on Roku device (both navigation and verification of certain app behaviour) and for this purpose downloaded rokudev/automated-channel-testing suite from git which uses API calls to interact with Roku device.

While experimenting with this suite I was able to use functions like web_driver.press_btn(button) to navigate around the app and functions like web_driver.verify_is_screen_loaded({"elementData": [{ "using": "text","value": “some value(s)”}]}) to find some elements (or not find as may be the case) on the current screen.

For example when running the function above, if an element with text “some value(s)” is discovered the script would receive API response True from Roku device.

According to the Roku WebDriver API documentation when finding some elements in this way, one should be able to use “text”, “tags” and “attributes” or any combination of these as a part of API call to find the element (or child of a parent containing these parameters) one is looking for. 

While I have had some success finding elements using “text” and “tag” I was less successful when trying to use attribute when looking for elements 

So, for example: web_driver.verify_is_screen_loaded({"elementData": [{"using": "text", "value": "Home"}], "parentData": [{"using": "tag", "value": "Button"}]}) will find a label with text “Home” which is situated/nested in an element of the type “Button” i.e. it would find “Button” with text “Home” in it,: 

However, web_driver.verify_is_screen_loaded({"elementData": [{"using": "text", "value": "Home"}, {"using": "attr","attribute": "color", "value": "colorValue"}]}) will not find anything even though I know for sure that the element with text “Home” and with colour value “colorValue” does exist (API request would return False) 

I would really appreciate any help help with this issue?

Also, has anybody been able to “find” playback element or way to read it’s state (play, stop, FF etc)

0 Kudos
1 REPLY 1
miketheiss
Reel Rookie

Re: Roku WebDriver APIs (automated-channel-testing)

Your post is from two months ago, so you have likely found a solution by now.  

The text + color query you posted below should work if the color matches the exact string of the color value of the *label* containing the text.  However, it sounded like you may have been looking for the button color, in which case you would need to locate the specific "Button" XML element and find the attribute of that, then find the text.   If you start by querying the text, it will find the label with the text and expect the attributes to match the label tag specifically.

The /player API call is the best way to to determine player status.   I haven't done much with UI elements inside the player yet, but it should work.   I find using the /source query to get the XML very helpful for crafting my locator queries.

 

 

 

 

0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.