Tackling the Top 5 Challenges of Salesforce App Test Automation

Tackling the Top 5 Challenges of Salesforce App Test Automation

The Salesforce1 mobile app is an enterprise-class app that provides users on phones or tablets with instant access to a company’s customer relationship management (CRM) data. Additionally, the Salesforce1 mobile application enables users to retrieve and update organization data. Before deciding to automate testing of the Salesforce1 application using standard mobile automation tools like Appium or Native Framework (e.g., Espresso for Android & XCUITest for iOS), there are a few challenges that enterprise customers should consider.

Hybrid App Challenges

Salesforce1 is a hybrid app by nature. All challenges associated with hybrid app automation also apply to Salesforce1. There are some native components and some components developed in Html5. Many components cannot be identified in automation.

Three key challenges of working on hybrid app automation vs. native app are:

  1. Context: Generally, hybrid apps run completely in a WebView and do not use elements in a native UI. This means you need to switch between contexts when an app is opened in order for these elements to be located by the driver.
  2. Selectors: Since elements are in WebView context, they essentially are the same as in web browsers. An easy way to inspect them is by using Chrome Remote debugger.
  3. Touch Actions: Simulating touch actions in a hybrid app is tricky because they’re not fully supported in WebView.

Switching context in different frameworks

If you are automating the Salesforce1 app for the Android platform using Espresso Native Framework, no separate code is needed to write for switching context from Native to WebView. Instead, you simply implement the “onWebView ()” method and perform whatever actions or verifications are needed. It offers a powerful and fast way to interact with the elements because Espresso test needs to write inside your application codebase. As such, users can access most of the elements, including any custom controls.

However, Espresso is only available for the Android platform; iOS requires a separate framework called XCUITest. Handling WebView in the XCUITest framework is tricky. It does not support a direct way to locate the element using CSS or Xpath-based strategies that are generally used in web automation. Additionally, WebView in iOS will only open in Safari, so you need an instance of Safari in your test to work with web elements.

If you want to get maximum reusability from one code base to automate for various platforms, Appium could be the better option compared to native frameworks for both native and hybrid apps. Appium API supports context switch between native to web and web to native.

Can’t get debug build

Salesforce doesn’t provide any debug Android package kit (APK). Users are dependent on the Play Store App, which can’t be instrumented due to security reasons. As such, Salesforce cannot identify many objects in the mobile app.

In Android, Appium requires a debug build in order to switch context to WebView from the native container. In this case, you may need to work with the development team to do the required changes in application source code to make WebView accessible for outside users. This is not required in iOS.

Dynamic contents

Salesforce Forms are dynamic in nature. As such, users can’t depend on xpath or an index-based locator strategy. Instead, users should use a label or relative locator strategy.

Using an open-source framework like our partner’s QMetry Automation Framework, which has in-built support for Salesforce applications, helps minimize efforts to handle complex form filling and provides label-based locator strategies. It also has in-built components to handle various complex controls like grid, selector, date picker and others.

Security constraints

Many times on Android, Salesforce won’t allow a user to take a screenshot due to Android security features. When this happens, you may need to work with the developer to disable the Android security flag or rely on a third-party screenshot solution like Screenshot Ultimate to solve the problem.

Performance

The Salesforce1 app performance on mobile platforms is a little slow. As such, your script may time out and fail. When designing your automation framework, you also need to account for the fact that the Salesforce platform is very data-heavy. Not having the right automation framework may cause failures. Following are tips to ensure better performance while automating Salesforce1:

  • Test your network connectivity: Since carrier and Wi-Fi signal quality can vary, always test your connection to the Salesforce app on a different network to determine whether the problem is due to network connectivity or an issue with the Salesforce mobile app platform.
  • Update your mobile OS and app software: Outdated software can cause problems in Salesforce for Android and iOS. Always uninstall older versions of the Salesforce mobile app and install the newest version from the app store. Additionally, be sure to use the newest versions of your mobile web browsers and Android or iOS to troubleshoot performance issues.
  • Clear your mobile cache: If you see a spinning arrow when you try to access Salesforce for Android or iOS, clear your mobile cache by using the steps provided by Salesforce.
  • Landing tabs: If you are experiencing slow loading when opening Salesforce for Android or iOS, check to see if one of these is used as the landing tab: Events, Today, any Lightning Component or Visualforce tab. If so, try using something like Chatter, Tasks or Smart Search Items as the landing tab.

Conclusion

Finalizing the right automation framework for the Salesforce Mobile App requires a detailed review and analysis of your applications and business objectives. Apexon can help identify the best automation strategy to get the most optimal coverage for your specific testing needs on Salesforce.

Interested in our Testing Services?

Please enable JavaScript in your browser to complete this form.
Checkboxes
By submitting this form, you agree that you have read and understand Apexon’s Terms and Conditions. You can opt-out of communications at any time. We respect your privacy.