Is it possible to use descriptive programming with UI Automation and Micro Focus UFT ?

  • Questions
  • Is it possible to use descriptive programming with UI Automation and Micro Focus UFT ?
Question ID: 108447
0
0

I am having UFT 12.54 version I had a question.

Is it possible to use descriptive programming with UI automation ?

I have not had to use the UI Automation method so I am not familiar with it.

~Thanks.

Marked as spam
Posted by (Questions: 26, Answers: 0)
Asked on June 14, 2018 12:57 pm
74 views
Answers (1)
0
Private answer

Use the UFT UI Automation Addin support with any Windows-based application that has implemented UI Automation provider interfaces. The support is loaded as with other add-ins, by selecting UI Automation in the Add-ins Manager when starting UFT.

Please see this eyeontesting article:

http://eyeontesting.com/questions/11690/how-exactly-do-i-use-ui-automation-in-uft.html

Yes, You can use Descriptive Programming with UI automation.

Here is the sample code for UI Automation object - Descriptive programming

For my examples I have created custom DP code for a sample website model window

URL - https://the-internet.herokuapp.com/exit_intent

'UFT UI code :

UIAWindow(''The Internet - Internet'').UIAObject(''The Internet'').UIAObject(''Close'').Click

'DP code for above UFT code :

'Creating a description object for

Set oDesc = Description.Create()

'Add descriptions and properties only mandatory properties from OR

oDesc(''name'').value = ''The Internet - Internet Explorer''
oDesc(''supportedpatterns'').value = ''Window;Transform;LegacyIAccessible''
oDesc(''frameworkid'').value = ''Win32''
oDesc(''controltype'').value = ''Window''
oDesc(''path'').value = ''*:*''

Environment(''Browser'') = oDesc

'Creating a description object for UIAObject(''The Internet'').

Set oDescUIOb1 = Description.Create()

'Add descriptions and properties only mandatory properties from OR

oDescUIOb1(''name'').value = ''The Internet''
oDescUIOb1(''supportedpatterns'').value = ''Text;ScrollItem;LegacyIAccessible''
oDescUIOb1(''frameworkid'').value = ''InternetExplorer''
oDescUIOb1(''controltype'').value = ''Pane''
oDescUIOb1(''path'').value = ''*:*::The Internet - Internet Explorer::*:The Internet''

Environment(''UIObject'') = oDescUIOb1

Set oUIWindow = UIAWindow(Environment(''Browser'')).UIAObject(Environment(''UIObject''))

'Creating a description object for UIAObject(''Close'').

Set oDescUIOb2 = Description.Create()

'Add descriptions and properties only mandatory properties from OR

oDescUIOb2(''name'').value = ''Close''
oDescUIOb2(''supportedpatterns'').value = ''Value;LegacyIAccessible''
'oDescUIOb1(''frameworkid'').value = ''InternetExplorer''
oDescUIOb2(''controltype'').value = ''Text''
oDescUIOb2(''path'').value = ''*:*::The Internet - Internet Explorer::*:The Internet:Close''

Environment(''UIObjectClose'') = oDescUIOb2

oUIWindow.UIAObject(Environment(''UIObjectClose'')).click

Hope this helps.

Marked as spam
Posted by (Questions: 0, Answers: 27)
Answered on June 14, 2018 1:26 pm