MobileAPI + CRM – using application related .xml files to build part of an automation framework

23
MobileAPI + CRM – using application related .xml files to build part of an automation framework TSIMAFEI AVILIN JANUARY 30, 2016

Transcript of MobileAPI + CRM – using application related .xml files to build part of an automation framework

Page 1: MobileAPI + CRM – using application related .xml files to build part of an automation framework

MobileAPI + CRM – using application related .xml files to build part of an automation frameworkTSIMAFEI AVILIN

JANUARY 30, 2016

Page 2: MobileAPI + CRM – using application related .xml files to build part of an automation framework

• Tsimafei Avilin

• 9+ years in IT - 3 years in Functional Testing,

6+ years in Automation Testing

• Test automation optimization, Test automation frameworks, Test Automation strategy

• Test Automation, Test Frameworks, Resource Management, QTP, TestComplete, WebDriver, API testing, .NET Automation, etc.

ABOUT ME

Page 3: MobileAPI + CRM – using application related .xml files to build part of an automation framework

Problem statement

Page 4: MobileAPI + CRM – using application related .xml files to build part of an automation framework

4CONFIDENTIAL

General example of passing data

Page 5: MobileAPI + CRM – using application related .xml files to build part of an automation framework

5CONFIDENTIAL

CRM + Mobile example

CRM Mobile

• FetchXML is a proprietary query language that is used in Microsoft Dynamics CRM Online 2016 Update and Microsoft Dynamics CRM 2016 (on-premises). It’s based on a schema that describes the capabilities of the language. The FetchXML language supports similar query capabilities as query expressions. In addition, it’s used as a serialized form of query, used to save a query as a user-owned saved view in the userquery entity and as an organization-owned saved view in the savedquery entity. link

Page 6: MobileAPI + CRM – using application related .xml files to build part of an automation framework

6CONFIDENTIAL

Simple test scenario

TC: Get all companies• Login• Verify all companies passed from the server• Verify all companies have correct data

Page 7: MobileAPI + CRM – using application related .xml files to build part of an automation framework

7CONFIDENTIAL

Common scenario

Page 8: MobileAPI + CRM – using application related .xml files to build part of an automation framework

8CONFIDENTIAL

Getting actual and expected data in TAF

Page 9: MobileAPI + CRM – using application related .xml files to build part of an automation framework

9CONFIDENTIAL

Company object

Company object has many properties, how do you decide which properties to use to: - create fetchXML; - parse response; - Compare actual and expected data; - How to store properties?

DB

HTML (response from mobile API)

Page 10: MobileAPI + CRM – using application related .xml files to build part of an automation framework

10CONFIDENTIAL

What you gonna do?

Page 11: MobileAPI + CRM – using application related .xml files to build part of an automation framework

11CONFIDENTIAL

Approach #1 : Kick and Get (KAG)

Role 1 Role 2

Page 12: MobileAPI + CRM – using application related .xml files to build part of an automation framework

12CONFIDENTIAL

Approach #2 : Cry and Get (CAG)

Role 1 Role 2

Page 13: MobileAPI + CRM – using application related .xml files to build part of an automation framework

13CONFIDENTIAL

Approach# 3: Think and Get (TAG)

тельняшка?

Page 14: MobileAPI + CRM – using application related .xml files to build part of an automation framework

14CONFIDENTIAL

Application architecture

Page 15: MobileAPI + CRM – using application related .xml files to build part of an automation framework

15CONFIDENTIAL

ANALYZE VIEW AND…

Page 16: MobileAPI + CRM – using application related .xml files to build part of an automation framework

16CONFIDENTIAL

… OBJECT

Page 17: MobileAPI + CRM – using application related .xml files to build part of an automation framework

17CONFIDENTIAL

Reading xml files

Both MobileAdapter and TAF read xml files located on the server independently

Page 18: MobileAPI + CRM – using application related .xml files to build part of an automation framework

18CONFIDENTIAL

Get view and object data

Views xml files Entities xml files

Page 19: MobileAPI + CRM – using application related .xml files to build part of an automation framework

19CONFIDENTIAL

Using it in your TAF

public static string[] GetUniqueXRMPropertiesByListView(EntityType ID, string listview) { var controls = GetAllControls(listview); var ignoreprop = GetIgnoreInCRMQueryProperties(ID); var props = controls.Where(c => ignoreprop.Contains(c.Property) != true) .Select(c => c.Property) .Distinct() .ToArray();

return props; }

[DllImport("advapi32.DLL", SetLastError = true)] public static extern int LogonUser(string lpszUsername, string lpszDomain, string lpszPassword, int dwLogonType, int dwLogonProvider, ref IntPtr phToken);

public void CreateRecentFile(XDocument xDoc, string fileName) { IntPtr admin_token = default(IntPtr); WindowsIdentity wid_current = WindowsIdentity.GetCurrent(); WindowsIdentity wid_admin = null; WindowsImpersonationContext wic = null; try {

Page 20: MobileAPI + CRM – using application related .xml files to build part of an automation framework

20CONFIDENTIAL

Workflow

Page 21: MobileAPI + CRM – using application related .xml files to build part of an automation framework

21CONFIDENTIAL

fetchXML files examples

You can check XML file contains information about• search• aggregate• filtering/sorting• whatever you have in xml to be under test…

Page 22: MobileAPI + CRM – using application related .xml files to build part of an automation framework

22CONFIDENTIAL

• NOT NEED TO THINK ABOUT PROPERTIES CHANGES

• SIMPLE PARSING OF XML FILES• SET OF PROPERTIES IS GENERATED

ON FLY

CONS PROS

PROS AND CONS

• DIFFICULT TO UNDERSTAND THIS APPROACH

• CROSS DOMAIN ISSUES• DO YOU HAVE SOMETHING TO

ADD?..

You even can control set of properties in xml file by creating kind of ‘template’ setAnd hence improve performance by removing unnecessary properties from dev. xml;

Page 23: MobileAPI + CRM – using application related .xml files to build part of an automation framework

23CONFIDENTIAL

Thank you for your attention!Questions?

Благодарствую-с за оказаные почести, судари и барышни!