UI Automation with Excel

I am new to user interface automation. At my current organization, I was tasked with creating an automated tool using a graphical user interface (GUI) screen, but it does not work perfectly with my other colleagues due to the difference in screen resolution.

I looked at this you-tube link to try and understand UI Automation using excel, but I can't find much on this topic anywhere else.

Can someone direct me to resources in UI Automation? I would like to know where I can find out, read about it and how to implement it using Excel.

Thanks in advance, I really appreciate if anyone can help me.

-2
source share
2 answers

Microsoft's UIAutomation is very powerful and works well with windows 7, 8, 10 also from visual databases for applications (32 and 64 bits) and can be convenient for performing some beautiful GUI automation without expensive tools.

Make sure there are UIAutomationCore.Dll links in the VBA link (and rather strange, sometimes on some computers you need to copy this to the documents folder)

Below you can see 2 basic examples, but since MS Automation is a huge library for all procedures, you can read a lot in MSDN for full documentation. I use MS UIA routines in AutoIt and in VBA

  • For AutoIt, share it here

https://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/

Explicit option

Sub test() Dim c As New CUIAutomation Dim oDesktop As IUIAutomationElement Set oDesktop = c.GetRootElement Debug.Print oDesktop.CurrentClassName & vbTab & oDesktop.CurrentName & vbTab & oDesktop.CurrentControlType End Sub 'Test uia just dumps all windows of the desktop to the debug window Sub testUIA() Dim allEl As IUIAutomationElementArray 'Returns an element array with all found results Dim oElement As IUIAutomationElement 'Reference to an element Dim ocondition As IUIAutomationCondition Dim i As Long Dim x As New clsUIA 'Just reference the three mainly used properties. many more are available when needed Debug.Print x.oDesktop.CurrentName & x.oDesktop.CurrentClassName & x.oDesktop.CurrentControlType Set ocondition = x.oCUIAutomation.CreateTrueCondition 'Filter on true which means get them all Set allEl = x.oDesktop.FindAll(TreeScope_Children, ocondition) 'Find them in the direct children, unfortunately hierarchies are strange sometimes 'Just reference the three mainly used properties. many more are available when needed For i = 0 To allEl.Length - 1 Set oElement = allEl.GetElement(i) ' If oElement.CurrentClassName = "PuTTY" Then Debug.Print oElement.CurrentClassName & oElement.CurrentName & oElement.CurrentControlType ' Debug.Print oElement.CurrentBoundingRectangle oElement.SetFocus DoEvents Sleep 2000 ' End If Next End Sub 
+1
source

It looks like you're doing automation using coordinates that change when you switch to a different resolution. If so, please automate your application with ID, class, Xpath, CSS, etc. This link will help you with the following: http://www.guru99.com/locators-in-selenium-ide.html

For automation using Excel, use the following link: http://www.guru99.com/all-about-excel-in-selenium-poi-jxl.html

0
source

Source: https://habr.com/ru/post/1274769/


All Articles