<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>appium ios</title>
	<atom:link href="https://robotqa.com/tag/appium-ios/feed/" rel="self" type="application/rss+xml" />
	<link>https://robotqa.com/blog</link>
	<description></description>
	<lastBuildDate>Fri, 07 Jun 2024 10:49:59 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.1</generator>
	<item>
		<title>Video Recording of iOS Appium Testing</title>
		<link>https://robotqa.com/blog/video-recording-of-ios-appium-testing/</link>
		
		<dc:creator><![CDATA[RobotQA]]></dc:creator>
		<pubDate>Fri, 07 Jun 2024 10:49:59 +0000</pubDate>
				<category><![CDATA[Automation Testing]]></category>
		<category><![CDATA[Testing Tools]]></category>
		<category><![CDATA[appium ios]]></category>
		<category><![CDATA[ios recording]]></category>
		<guid isPermaLink="false">https://robotqa.com/blog/?p=457</guid>

					<description><![CDATA[In the realm of mobile test automation, video recording of test sessions is an invaluable feature. It helps in debugging, providing visual evidence of test failures, and sharing test results with stakeholders. While Appium offers built-in support for video recording...]]></description>
										<content:encoded><![CDATA[<p><img fetchpriority="high" decoding="async" class="aligncenter size-full wp-image-460" src="http://blog.robotqa.com/wp-content/uploads/2024/06/2024060710491553.jpeg" alt="ios-video-record" width="1024" height="615" srcset="https://blog.robotqa.com/wp-content/uploads/2024/06/2024060710491553.jpeg 1024w, https://blog.robotqa.com/wp-content/uploads/2024/06/2024060710491553-300x180.jpeg 300w, https://blog.robotqa.com/wp-content/uploads/2024/06/2024060710491553-768x461.jpeg 768w, https://blog.robotqa.com/wp-content/uploads/2024/06/2024060710491553-750x450.jpeg 750w" sizes="(max-width: 1024px) 100vw, 1024px" /> In the realm of mobile test automation, video recording of test sessions is an invaluable feature. It helps in debugging, providing visual evidence of test failures, and sharing test results with stakeholders. While Appium offers built-in support for video recording on Android, recording iOS test sessions requires a bit more setup. In this blog, we’ll delve into the process of recording iOS Appium test sessions, covering the tools needed, setup steps, and best practices.</p>
<h3><strong> Why Record Test Sessions?</strong></h3>
<p>Before diving into the technical details, let&#8217;s understand the benefits of recording test sessions:</p>
<ol>
<li><strong>Debugging:</strong> Video recordings help identify visual bugs that might not be evident from logs alone.</li>
<li><strong>Documentation:</strong> Recordings provide a clear documentation of test cases and their outcomes.</li>
<li><strong>Collaboration:</strong> Sharing recordings with team members or stakeholders facilitates better communication and understanding of issues.</li>
<li><strong>Regressions:</strong> Video evidence can be used to quickly spot regressions by comparing current test runs with previous ones.</li>
</ol>
<h3><strong>Tools and Prerequisites</strong></h3>
<p>To record iOS Appium test sessions, you’ll need the following tools:</p>
<ol>
<li><strong>Appium:</strong> The automation framework itself.</li>
<li><strong>Xcode:</strong> Apple&#8217;s integrated development environment for macOS.</li>
<li><strong>ffmpeg:</strong> A powerful multimedia framework to handle video recording.</li>
<li><strong>QuickTime Player:</strong> For manual recording (if needed).</li>
<li><strong>Node.js:</strong> Required for Appium installation.</li>
</ol>
<p>Ensure you have the following prerequisites:</p>
<ul>
<li>A macOS machine with Xcode installed.</li>
<li>An iOS device or simulator.</li>
<li>Appium server and client set up on your machine.</li>
<li>Homebrew (for installing <code>ffmpeg</code>).</li>
</ul>
<p></p>
<!-- CTA Section -->
<div class="bg-primary text-white text-center">
<div class="container space-1"><span class="h6 d-block d-lg-inline-block font-weight-light mb-lg-0"> <span class="font-weight-semi-bold">Need testing?</span> – Try RobotQA and Start Testing on Real Devices. </span> <a class="btn btn-sm btn-white transition-3d-hover font-weight-normal ml-3" href="/register">Start Free Trial</a></div>
</div>
<p>&nbsp;</p>
<h3><strong>Setting Up Video Recording</strong></h3>
<h4>Step 1: Install <code>ffmpeg</code></h4>
<p>First, install <code>ffmpeg</code> using Homebrew. Open Terminal and run:</p>
<pre class="lang:sh decode:true ">brew install ffmpeg
</pre>
<h4>Step 2: Configure Appium</h4>
<p>Ensure Appium is installed and configured correctly. If you haven&#8217;t installed Appium, use the following command:</p>
<pre class="lang:sh decode:true ">npm install -g appium
</pre>
<p>Start the Appium server with:</p>
<pre class="lang:sh decode:true ">appium
</pre>
<h4>Step 3: Start Recording Using <code>ffmpeg</code></h4>
<p>Use <code>ffmpeg</code> to record the iOS simulator screen. Here’s a command to start recording:</p>
<pre class="lang:sh decode:true ">ffmpeg -f avfoundation -i "&lt;device_index&gt;" -r 30 -pix_fmt yuv420p -t &lt;duration&gt; output.mp4
</pre>
<ul>
<li><code>&lt;device_index&gt;</code>: The index of your iOS device. You can find this by running <code>ffmpeg -f avfoundation -list_devices true -i ""</code>.</li>
<li><code>&lt;duration&gt;</code>: The duration for which you want to record the video (in seconds).</li>
</ul>
<h4><strong>Step 4: Integrate Recording into Appium Test Scripts</strong></h4>
<p>You can automate the start and stop of video recording within your Appium test scripts. Below is an example in Java:</p>
<pre class="lang:java decode:true ">import io.appium.java_client.MobileElement;
import io.appium.java_client.ios.IOSDriver;
import io.appium.java_client.remote.MobileCapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;

import java.net.URL;
import java.io.IOException;

public class AppiumTestWithRecording {
    private static Process ffmpegProcess;

    public static void startRecording() throws IOException {
        String[] command = {"ffmpeg", "-f", "avfoundation", "-i", "&lt;device_index&gt;", "-r", "30", "-pix_fmt", "yuv420p", "-t", "60", "output.mp4"};
        ffmpegProcess = new ProcessBuilder(command).start();
    }

    public static void stopRecording() {
        if (ffmpegProcess != null) {
            ffmpegProcess.destroy();
        }
    }

    public static void main(String[] args) {
        DesiredCapabilities caps = new DesiredCapabilities();
        caps.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS");
        caps.setCapability(MobileCapabilityType.PLATFORM_VERSION, "14.4");
        caps.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 12");
        caps.setCapability(MobileCapabilityType.APP, "/path/to/your/app.app");
        caps.setCapability(MobileCapabilityType.AUTOMATION_NAME, "XCUITest");

        try {
            startRecording();

            IOSDriver&lt;MobileElement&gt; driver = new IOSDriver&lt;&gt;(new URL("http://localhost:4723/wd/hub"), caps);

            // Your test steps here
            MobileElement loginButton = driver.findElementByAccessibilityId("loginButton");
            loginButton.click();

            // Additional test steps...

            driver.quit();
            stopRecording();
        } catch (Exception e) {
            e.printStackTrace();
            stopRecording();
        }
    }
}
</pre>
<h3><strong>Best Practices for Video Recording in Tests</strong></h3>
<ol>
<li><strong>Start/Stop Recording Programmatically:</strong> Automate the start and stop of recordings within your test scripts to ensure consistent capture.</li>
<li><strong>Manage Storage:</strong> Regularly clean up old recordings to manage storage space effectively.</li>
<li><strong>Use Descriptive File Names:</strong> Name your recording files with timestamps or test case identifiers for easy identification.</li>
<li><strong>Monitor Performance:</strong> Ensure that recording does not significantly impact the performance of your test runs. Adjust frame rate and resolution settings if necessary.</li>
<li><strong>Review Recordings:</strong> Regularly review recordings to identify flaky tests or intermittent issues that logs alone might not reveal.</li>
</ol>
<h3><strong>Conclusion</strong></h3>
<p>Video recording of iOS Appium testing sessions is a powerful feature that enhances the debugging, documentation, and collaboration aspects of mobile test automation. By following the steps outlined in this blog, you can set up and integrate video recording into your Appium test scripts, ensuring a more robust and informative testing process. Whether you are capturing visual evidence of test failures or documenting test runs for stakeholders, video recordings are an invaluable addition to your mobile testing toolkit.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Top 5 Appium iOS Commands for Effective Appium Testing</title>
		<link>https://robotqa.com/blog/top-5-appium-ios-commands-for-effective-appium-testing/</link>
		
		<dc:creator><![CDATA[RobotQA]]></dc:creator>
		<pubDate>Thu, 06 Jun 2024 15:14:35 +0000</pubDate>
				<category><![CDATA[Automation Testing]]></category>
		<category><![CDATA[Testing Tools]]></category>
		<category><![CDATA[appium ios]]></category>
		<category><![CDATA[appium ios command]]></category>
		<guid isPermaLink="false">https://robotqa.com/blog/?p=453</guid>

					<description><![CDATA[Appium is a powerful tool for automating mobile applications across both Android and iOS platforms. When it comes to iOS, Appium leverages the XCTest framework to interact with the app&#8217;s UI elements. For those getting started or looking to enhance...]]></description>
										<content:encoded><![CDATA[<img decoding="async" class="aligncenter size-full wp-image-455" src="http://blog.robotqa.com/wp-content/uploads/2024/06/2024060615125349.png" alt="appium-ios" width="1400" height="735" srcset="https://blog.robotqa.com/wp-content/uploads/2024/06/2024060615125349.png 1400w, https://blog.robotqa.com/wp-content/uploads/2024/06/2024060615125349-300x158.png 300w, https://blog.robotqa.com/wp-content/uploads/2024/06/2024060615125349-1024x538.png 1024w, https://blog.robotqa.com/wp-content/uploads/2024/06/2024060615125349-768x403.png 768w" sizes="(max-width: 1400px) 100vw, 1400px" />

Appium is a powerful tool for automating mobile applications across both Android and iOS platforms. When it comes to iOS, Appium leverages the XCTest framework to interact with the app&#8217;s UI elements. For those getting started or looking to enhance their iOS test scripts, understanding the top commands can significantly improve test efficiency and robustness. In this blog, we’ll explore five essential Appium iOS commands that every tester should know.
<h3>1. <code>findElementByAccessibilityId</code></h3>
One of the most reliable ways to locate elements in iOS apps is by using accessibility IDs. These IDs are assigned to UI elements for accessibility purposes, making them excellent identifiers for automation.
<h4>Example</h4>
<pre class="lang:java decode:true ">MobileElement element = driver.findElementByAccessibilityId("loginButton");
element.click();
</pre>
<h4>Why Use It?</h4>
<ul>
 	<li><strong>Reliability:</strong> Accessibility IDs are less likely to change compared to other attributes.</li>
 	<li><strong>Performance:</strong> Finding elements by accessibility ID is faster than other methods such as XPath.</li>
</ul>
<p>&nbsp;</p>
<!-- CTA Section -->
<div class="bg-primary text-white text-center">
<div class="container space-1"><span class="h6 d-block d-lg-inline-block font-weight-light mb-lg-0"> <span class="font-weight-semi-bold">Need testing?</span> – Try RobotQA and Start Testing on Real Devices. </span> <a class="btn btn-sm btn-white transition-3d-hover font-weight-normal ml-3" href="/register">Start Free Trial</a></div>
</div>
<p>&nbsp;</p>
<h3>2. <code>findElementByClassChain</code></h3>
Class Chain queries provide a more efficient and readable way to locate elements based on their class names and hierarchical structure. This method is especially useful for complex UI hierarchies.
<h4>Example</h4>
<pre class="lang:java decode:true ">MobileElement element = driver.findElementByClassChain("**/XCUIElementTypeButton[`label == 'Submit'`]");
element.click();
</pre>
<h4>Why Use It?</h4>
<ul>
 	<li><strong>Performance:</strong> Class Chain queries are faster than XPath.</li>
 	<li><strong>Flexibility:</strong> Allows for complex hierarchical queries with a simple syntax.</li>
</ul>
<h3>3. <code>mobile: scroll</code></h3>
Scrolling is a common action in mobile apps, and Appium provides a native way to perform scroll actions using the <code>mobile: scroll</code> command. This command is particularly useful for navigating through lists or finding elements that are not immediately visible.
<h4>Example</h4>
<pre class="lang:java decode:true ">Map&lt;String, Object&gt; params = new HashMap&lt;&gt;();
params.put("direction", "down");
driver.executeScript("mobile: scroll", params);
</pre>
<h4>Why Use It?</h4>
<ul>
 	<li><strong>Native Interaction:</strong> Uses native scrolling, which is more reliable and faster than custom swipe actions.</li>
 	<li><strong>Precision:</strong> Can scroll in specific directions, ensuring the right elements come into view.</li>
</ul>
<h3>4. <code>mobile: swipe</code></h3>
Similar to scrolling, swiping is another common action in mobile apps. The <code>mobile: swipe</code> command allows you to simulate swipe gestures, which can be useful for navigating through app pages or dismissing notifications.
<h4>Example</h4>
<pre class="lang:java decode:true ">Map&lt;String, Object&gt; params = new HashMap&lt;&gt;();
params.put("direction", "left");
driver.executeScript("mobile: swipe", params);
</pre>
<h4>Why Use It?</h4>
<ul>
 	<li><strong>Native Gesture:</strong> Executes a native swipe gesture, which is more accurate than custom swipe implementations.</li>
 	<li><strong>Versatility:</strong> Can be used to perform swipe actions in any direction.</li>
</ul>
<h3>5. <code>mobile: tap</code></h3>
Tapping is a fundamental action in mobile apps. The <code>mobile: tap</code> command allows you to perform tap actions at specific coordinates or on specific elements. This command is especially useful when dealing with elements that are not easily accessible through traditional locators.
<h4>Example</h4>
<pre class="lang:java decode:true ">Map&lt;String, Object&gt; params = new HashMap&lt;&gt;();
params.put("x", 100);
params.put("y", 200);
driver.executeScript("mobile: tap", params);
</pre>
<h4>Why Use It?</h4>
<ul>
 	<li><strong>Precision:</strong> Can tap at specific coordinates, useful for custom controls or elements without unique identifiers.</li>
 	<li><strong>Flexibility:</strong> Can be used on any screen area, ensuring broad applicability.</li>
</ul>
<h3><strong>Conclusion</strong></h3>
Mastering these top five Appium iOS commands can significantly enhance your test automation scripts. Using <code>findElementByAccessibilityId</code> and <code>findElementByClassChain</code> ensures you can reliably and efficiently locate elements. Commands like <code>mobile: scroll</code> and <code>mobile: swipe</code> allow for smooth navigation within your app, while <code>mobile: tap</code> provides precise interaction capabilities. By incorporating these commands into your test scripts, you can create more robust, efficient, and maintainable automated tests for your iOS applications.

With these powerful tools at your disposal, you&#8217;re well on your way to becoming an Appium expert, capable of handling even the most complex iOS testing scenarios. Happy testing!]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Basics of Webdriveragent Appium iOS testing</title>
		<link>https://robotqa.com/blog/webdriveragent-ios-testing/</link>
		
		<dc:creator><![CDATA[RobotQA]]></dc:creator>
		<pubDate>Fri, 31 May 2024 09:17:05 +0000</pubDate>
				<category><![CDATA[Automation Testing]]></category>
		<category><![CDATA[appium ios]]></category>
		<category><![CDATA[ios testing]]></category>
		<category><![CDATA[wda]]></category>
		<category><![CDATA[webdriveragent]]></category>
		<guid isPermaLink="false">https://robotqa.com/blog/?p=275</guid>

					<description><![CDATA[About WebdriverAgent  Webdriver agent (WDA)  is an open-source project used for iOS automation testing by Appium. This project is responsible for actions ie. clicking, swiping, tapping. Initially started by Facebook (Github link), the project has been archived, and now the...]]></description>
										<content:encoded><![CDATA[<p><img decoding="async" class="aligncenter size-full wp-image-277" src="http://blog.robotqa.com/wp-content/uploads/2024/05/2024053109164832.png" alt="wda-xcode" width="3024" height="1994" srcset="https://blog.robotqa.com/wp-content/uploads/2024/05/2024053109164832.png 3024w, https://blog.robotqa.com/wp-content/uploads/2024/05/2024053109164832-300x198.png 300w, https://blog.robotqa.com/wp-content/uploads/2024/05/2024053109164832-1024x675.png 1024w, https://blog.robotqa.com/wp-content/uploads/2024/05/2024053109164832-768x506.png 768w, https://blog.robotqa.com/wp-content/uploads/2024/05/2024053109164832-1536x1013.png 1536w, https://blog.robotqa.com/wp-content/uploads/2024/05/2024053109164832-2048x1350.png 2048w" sizes="(max-width: 3024px) 100vw, 3024px" /></p>
<p><strong>About WebdriverAgent </strong></p>
<p>Webdriver agent (WDA)  is an open-source project used for iOS automation testing by Appium. This project is responsible for actions ie. clicking, swiping, tapping. Initially started by Facebook (Github <a href="https://github.com/facebookarchive/WebDriverAgent">link</a>), the project has been archived, and now the Appium team continues development in a new <a href="https://github.com/appium/WebDriverAgent">repo</a>. We strongly recommend both installing WebDriverAgent manually before iOS testing and Appium WDA configuration. That is why Appium will attempt to install its own WDA inside node modules <span class="s1"><strong>appium-xcuitest-driver/node_modules/appium-webdriveragent</strong>. So that, you have to configure WDA (the same steps of manual configuration) inside of Appium before testing.</span></p>
<p><strong>How to Install WDA</strong></p>
<p>Firstly, download the WDA Release <a href="https://github.com/appium/WebDriverAgent/releases">package</a>.</p>
<p><strong><em>NOTE: </em></strong>Do not clone the repo. Sometimes, pre-release commits cause the unexpected behavior during testing.</p>
<p>After that, firstly we have to configure &#8220;Signing &amp; Capabilities&#8221; of <strong>WebDriverAgentRunner</strong> and <strong>WebDriverAgentLib</strong> targets. Select your Team signing option and build the WebDriverAgentRunner project: Product&#8211;&gt;Build For&#8211;&gt;Testing.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-276" src="http://blog.robotqa.com/wp-content/uploads/2024/05/202405310915498.jpg" alt="wda-ios-testing" width="4284" height="5712" /></p>
<p>Building WDA can be stressful and challenging. If you encounter any issues, please contact us, and we will share a blog about it.</p>
<p>Once the project build is finished, install WDA on your device. To install WDA, go to Product&#8211;&gt;Perform Action&#8211;&gt;Test Without Building option. This will install WDA to your device and start WDA server (default port is: 8100). You will see the &#8220;Automation Running&#8221; interface on your device screen, indicating that you have successfully configured and installed WDA on your phone. Do not forget to follow the same steps for Appium WDA <span class="s1"><strong>appium-xcuitest-driver/node_modules/appium-webdriveragent. </strong>Now you are ready for Appium iOS testing. </span></p>
<p>Happy Testing</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
