mobileapi + crm – using application related .xml files to build part of an automation framework

Post on 15-Apr-2017

150 Views

Category:

Software

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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

JANUARY 30, 2016

• 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

Problem statement

4CONFIDENTIAL

General example of passing data

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

6CONFIDENTIAL

Simple test scenario

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

7CONFIDENTIAL

Common scenario

8CONFIDENTIAL

Getting actual and expected data in TAF

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)

10CONFIDENTIAL

What you gonna do?

11CONFIDENTIAL

Approach #1 : Kick and Get (KAG)

Role 1 Role 2

12CONFIDENTIAL

Approach #2 : Cry and Get (CAG)

Role 1 Role 2

13CONFIDENTIAL

Approach# 3: Think and Get (TAG)

тельняшка?

14CONFIDENTIAL

Application architecture

15CONFIDENTIAL

ANALYZE VIEW AND…

16CONFIDENTIAL

… OBJECT

17CONFIDENTIAL

Reading xml files

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

18CONFIDENTIAL

Get view and object data

Views xml files Entities xml files

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 {

20CONFIDENTIAL

Workflow

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…

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;

23CONFIDENTIAL

Thank you for your attention!Questions?

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

top related