Testing tvOS in Appium for Apple TV 1080 and 4K
HeadSpin volunteer a twist cloud that can be used for testing design and monitoring your applications ’ performance characteristics. Our device cloud currently has a, such as every poser of iPhone and iPad, Apple TV, and many different kinds of Android devices, include non-smartphone devices such as Fire TV. HeadSpin supports the open source natively. Appium is an diligence touchstone fabric for machine-controlled test for mobile devices, as easily as being a general framework for testing other kinds of system, include web browsers. Clients can use Appium written in a diverseness of languages such as Java, Ruby, or Python to interact with a Napkin server over the net with an http interface. All that is needed to run an Appium examination on the is the HeadSpin API item, which you can get from the HeadSpin UI in the URL for the Appium remote waiter. Appium supports iOS devices natively in all versions of Appium. Currently HeadSpin provides adaptation – [backtrack] With Appium, all you postulate is the HeadSpin API item and the remote driver URL. Appium support iOS on iPhones and iPads from variant of 1.6 to 1.13, and HeadSpin currently supports these versions. In Appium 1.13 and above, there is support for tvOS running on Apple TV device. Unfortunately, the exposed origin Appium version can only support Apple TV 4th coevals and below, but not the Apple TV 4K. The intellect for this is that the Apple TV 4K only has network connectivity rather than USB. And the exposed source tools currently but support USB. Luckily, HeadSpin has developed a result that works for meshing devices such as the 4K for Appium and preserve to work great. If you look at the hardware of an Apple TV 4th generation, we can see that it has a USB-C connexion for communicating with the host, an HDMI output porthole for power and an Ethernet port for network connectivity. It too has WiFi support, so ethernet is optional. The 4th generation gimmick can yield a frame with a maximal resolution of 1920 x 1080. The Apple TV 4K is similar to the 4th generation but lack a USB connection. It can output a frame size of 3840 x 2160 and can use either WiFi or Ethernet to communicate over the network. Running an Appium test on an iOS twist requires that a set of configuration variable be passed to it. A minimal set of configuration variable are shown here. The configuration establish the udid of the device and gens, which doesn ’ t have to be unique. The automation name that ever must be an XCUI tryout, the platform of the mobile device, and an app or bundle ID. In this suit, I ’ ve chosen the default computer app that is installed on every iOS device. To run on an Apple TV, we simply need to change the platform to tvOS – Calculator is not installed on an Apple TV. So, I will use the YouTube app alternatively. YouTube can be download from the App Store on the Apple TV. Since Apple TV is only supported on Appium 1.13 and higher, it is likewise a good idea to specify the Appium edition. If this is left out, HeadSpin will default to the highest variation it has available, which may not be exactly the same variation that you want to use. So, it is better to explicitly specify it with the HeadSpin Appium version capacity. Here we hold a simple Python script that demonstrates how an Appium is set up. We can take this set of capabilities structured as a lexicon in Python, and pass them as an argument to the WebDriver object. We must too surpass the distant URL that I had mentioned before, and I will show you how to get that URL in a mo. In the HeadSpin UI, in the remote control tab, we see the list of devices we have access to. If I snap on the three vertical dit on the right side, it will open up a duologue box to show me that Appium configuration. In this shape, we can get the remote driver URL that can be passed in the Python script, as well as the default set of capabilities that can be used for depart a test. Note that here, it do not specify the Appium version, so you may want to include that yourself. If you look at the remote control gimmick list, again, we can tick the start button to profit manual control over the device. That will take us to this UI, where we see the device and some info about it on the right side. This screen shew it working for the Apple TV 4th generation and this next screen present it working for Apple TV 4K. When lam an Appium exam, the start push will change into a looking glass that lets you watch the test as it lead in real clip. When you chatter the looking glassful, you ’ re presented with a view of the gimmick. We can add an additional capableness that will let HeadSpin capture the video as good as the Appium test runs. If we add “ headspin: capture.video ” as set it to true, then HeadSpin does all the work for us necessary for saving the video. The resulting picture can be viewed by go to the HeadSpin UI and tick on the P push on the left. This will wreak up the session list that testify all the recordings of devices done so far. Clicking on one of the session convey up the session UI. In this UI, we see that the video was saved for the session on the rightfield, some analysis of the video on the bottom, and you download the video and Appium logs from the left side. Now I will demonstrate a running an Appium test on a 4K Okay, so first I ’ m logging into the HeadSpin UI – let me get my depot, so I can really run the test. [Pause.] If you seem at the devices that are attached, that I have admittance to, it tells me I have an Apple TV 4th contemporaries, an Apple TV 4K, and two iPhones. So, when I run my test, straightaway we see the looking glass. I can click on it and so it takes a match of second for initialization to occur. But immediately we see the device blind. Here ’ s the HeadSpin loading program. The initiatory thing it does is go to the abode screen of the Apple TV twist. And now at this moment Appium is loading and it ’ s about to launch YouTube, and it will try to play a YouTube video for a couple of seconds. After this test has end, it ’ s going to salve the video and then we can look at it in the session UI. SUSA automates exploratory testing with persona-driven behavior, catching bugs that scripted automation misses. So, our test has dispatch. Now we can go over to P, look at the tryout we exactly did. Here ’ s the video that just got saved. And there ’ s YouTube. And we can download the Appium log, the device log and the raw video file itself as an MP4. So, thank you for watching the demo and now Kazu will go over item about implementing an Appium test for Apple TV. Over to your Kazu. Hi, I ’ m Kazu. I work as a Senior Software Engineer at HeadSpin. I also heavily contribute to the Appium labor. Now, I ’ d like to demonstrate Appium bidding for tvOS. As Jon explained before, Appium is supporting tvOS from Appium version 1.13. The only thing they should do is set platform gens as tvOS. Other than that, all dictation are the same for their Appium tests running on tvOS. In this demo I will use ruby_console, which is a CRI tools. The library is written in Ruby, so it can likewise be utilize with Appium Ruby client. The commands I ’ ll show you should it be leisurely to use in other clients too. Okay, let ’ s continue the demo. ruby_console supports “ toml ” format to set capabilities. Ruby_console will launch by arc toml and some configuration text. When the command starts, the customer post their current session command to Appium server. After establishing their connections, we can send bid to the servers. Let ’ s share their potentiality. [Pause.] These are our capabilities I run from now, and the automation name is that XCUI test, and our platform name is tvOS. And today, I will launch the TV stows provided by Apple, and this waiter URL is the WebDriver URL. There, we specified their URL, and then the client tries to connect to their own platform. So, let ’ s connect through to our platform. [Pause.] After running the command, let ’ s see, there ’ s our platform page. And then, I can see the red ikon on our gimmick inclination. It means their device is lock. And let ’ s see, there are details. And, on this screen, we can see the progress and we can also see their Appium logs on this side. We can hide and show the logarithm. Let me hide the logs for now. It looks like they already finished establishing the connection. Appium has a command to confirm the app province on the device. We could say app_state – we can direct a command to tvOS to get their state. In order to ensure that TV shows up is really running, “ app_state TV shows ” – then the running in foreground is returned. This is our current test scene, and actually the tvOS display are running. If you require to establish the app, which is already in the twist, you can launch it too. For representative, let ’ s open the Settings app. “ activate_app ‘ com.apple.TVSettings ’ ” – then, the Settings app launched. Either the TV shows went to the background or it ’ s but not running. So, let ’ s see the app_state of the TV shows. The province says that plainly, there are TV shows scat in the ground and their Settings app is programme. Back to the TV shows. In the UI testing vista hierarchy, it ’ s a very mutual method to write test instance, finding variable elements, attributes, etc. If the target vista had standard UI elements, you can get the view – view tree – like this external formal. The formatting is very complicated, but really we can see there ’ s XML format that appear in their consul. If the mark app is more complicated or exceeds test framework, the response becomes slower since Appium adds assorted attributes in the source tree such as visibility testing or some other outside attribute in the tree. When we want to search for something in the app, we often type textbook in the search field. Appium supports sending a textbook for tvOS, with iOS. Let ’ s go to the search bar on this view. If you have experience with Appium, you probably wonder whether regain elements works on tvOS. Yes, of course you can direct, “ findElement: ” – then, let ’ s go to the hunt bar at the top, type “ Search ” – and the search word is here, under screen tree. If you view tree, you can see that element in the search. So, let ’ s send a “ findElement ” – accessibility ID and search. We can get the element. Now, let ’ s see the text attribute. And now, let ’ s go to the search. The screensaver appears. So let ’ s trip our TV show again. On tvOS, we should have a physical case case for example, up, down, correct, left to displace the focus country. The focus is in top TV shows, so the focussing isn ’ t in the hunting tab at the top. So first we must move their direction to the search, but Appium has a feature to move the focus automatically. If Appium can notice the focus element and the target element correctly, we already hold our factor on their search mode. So, let ’ s just send a dog. I didn ’ t touch anything, and Appium has changed the focusing of the search tab, and show the search tab in the view. Now, let ’ s look at the source in here. Around here, there is a search field. So from now, I require to type and send a text from the hunt field. Let ’ s find the hunt field in the seed tree. This “ XCUIElementTypeSearchField ” may be the search field. So, let ’ s get the search field. But the constituent may not feature a schoolbook or name attribute, so we can not get this element using the accessibility ID. So, let ’ s get the element using the class name. We can get the element, and the schoolbook, and try to send keys, for instance “ Spiderman ” – so, their key is send to their tvOS – Spiderman, the results are also shown. We can direct a multiple byte string to their key. “ Clear ” the text battlefield and type in the text battlefield “ Spiderman ” in Japanese. The search results don ’ t play up anything because this is the US region. Back on the home screen, I type the mobile bidding here. This bidding character supply Appium-specific, and gimmick or Appium-driver-specific, clients. Most customer receive execute_script command as the fundamental command gens. It means they can use their mobile command without update anything on the client side. This “ pressButton ” provides the feature of exhort physical buttons on their devices via exit test framework, so this “ pressButton ” abode means urge the home button on their remote control, which is provided for tvOS. Now we ’ re on the habitation blind. When we want to get a current focused element to confirm where the focus is. You can call “ getActiveElement ” in Ruby context. “ Switch to active element ” is the method to get a current focused element. Currently, “ Watch Now ” is the focus on the screen, so let ’ s get the schoolbook. The textbook has “ Watch Now ” – so, the current focused factor is “ Watch Now. ” On tvOS, the active element agency rivet element – Appium transfers from go active elements to getting focused tvOS contexts, so you don ’ t convert such different contexts between iOS and tvOS. Appium translate them automatically. Now, let ’ s open YouTube. What ’ s interesting on YouTube is we can not get elements via source. Let ’ s case the source. We can only see the “ germ tree only ” pattern. In this case we can not use “ findElement ” and click “ getElement ” – for example, there are some screen icons, a habitation picture, a lookup ikon. But in this lawsuit, Appium provides all of the removed control commands, so we can move the focussed elements using the remote controller. As for the type of command we can do, we can see the remainder of the error message. I just typed a long command named “ pressButton ” – the unit up downwardly left right card, so we can use them. Now, let ’ s play the YouTube video using this dictation. Currently, the focus is this very cunning cat. And, when you try to send a lift, the focus moves to the home icon. And let ’ s send it down, for example. In that case, the ability is down and the shows are on our screen. Back to the home ikon – rightfield is back to the cat view. And, if we send our “ select ” bidding, it means just select the focused component. On YouTube, we can see that there ’ s a progression bar, but tvOS has its dictation stop and drama again. The dictation is named “ play plause ” – of course, Appium also supports that bid. Once you send the command, the movie stops, and when you mail it again, the movie get again. Okay, let ’ s go back to the home and send an going. From ruby_console, I mail our issue bidding. The bidding is closing the session, and after fold the session, on this view, the device prospect appears, and the devices go back to normal and the Appium session finished. In this demo, I went through specific bidding for tvOS. For instance, find_element, click, pressButton, getActiveElement, send_keys, app_state, and page_source. And some tips refer test cases for tvOS. tvOS also has animation, just like iOS. So, you can use a wait method to make test cases stable. We have no official way to disable spiritedness in the system level. And, please make sure your examination mark is running in the foreground before starting your trial. The state will be background if the screensaver is presented. During this demo, the threshold became 1 – in that case, we must disenable the screensaver using the place button or activate the app. All right, thank you Kazu. In summary, HeadSpin render support for running Appium tests on Apple TV and Apple TV 4K devices with minimal frame-up for the node. Be sure to use the roving pressButton and Associated APIs for Appium commands to actually interact with the TV as it does not support swiping behavior that is standard on iOS devices. Lastly, even though you may not be capable to examine the real Apple TV 4K locally, the scripts you write for an Apple TV 4th generation will act on a 4K. Also, Appium scripts bunk on a simulated 4K will also act on a real 4K. Thank you all for your time today. And if you feature any enquiry, delight send them this way. Q&A Q: How can I establish my coating? A:HeadSpin volunteer an API that you can use remotely to upload an IPA to our platform, which will get install automatically on a device of your choosing, include an Apple TV. Q: How long perform it take for the Appium session to start? A:It can vary a little bit, but typically between 15 and 30 minute. Lead, Content Marketing, HeadSpin Inc. Piali is a dynamic and results-driven Content Marketing Specialist with 8+ years of experience in crafting engage tale and marketing collateral across various industries. She excels in collaborating with cross-functional teams to evolve innovative message strategies and present compelling, authentic, and impactful content that resonate with target audiences and enhances brand authenticity. Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed. Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts..png)



Testing tvOS in Appium for Apple TV 1080 and 4K
AI-Powered Key Takeaways
Check out:
Also see -
Read:
Recommended Post:
See also:
Also tab:
Piali Mazumdar
Testing tvOS in Appium for Apple TV 1080 and 4K
4 Parts
-1280X720-Final-2.jpg)
Regression Intelligence practical guide for innovative users (Part 3)
-1280X720-Final-2.jpg)
Regression Intelligence practical usher for advanced user (Part 4)
Discover how HeadSpin can empower your line with superior testing capabilities







Discover how HeadSpin can invest your concern with superior testing capabilities
Discover how HeadSpin can empower your concern with superior testing capability
Connet Now


Automate This With SUSA
Test Your App Autonomously







.png)











