Understanding Desired Capabilities

In the last chapter, we saw that the boilerplate code generated by Appium Inspector had a bunch of lines that used the DesiredCapabilities class and passed a certain set of keys and values to the Appium server. In this chapter, we will take a detailed look at the following:

  • Appium server arguments
  • Desired capabilities for Android
  • Desired capabilities for iOS
  • iOS XCUITest related iOS capabilities

Before we take a dive in there, we will refactor the code written in the last chapter and introduce the concept of hooks before and after, which acts like setup and tear down and will take care of starting the Appium server programmatically and then stopping it.

In test automation with Appium, all the commands are executed in the context of a session. A session is initiated by a client with a server in ways either specific to Android or iOS and with a JSON object called desired capabilities.

Let's refactor the existing code to add handling the Appium server through code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.186.143