I’m exploring the idea of creating integrations tests for my FMX app. Ideally I’d be able to execute these tests for multiple platforms (Windows, Android, iOS, macOS), but for now I’m just trying to get it to work on Windows (64-bit) first using WinAppDriver.
I’ve created this Python script
from appium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import os
os.startfile('C:\Program Files\Windows Application Driver\WinAppDriver.exe')
desired_caps = {
'app': "E:\appiumtest\integrationtestdemoproj.exe",
'platformName': "Windows",
'deviceName': "WindowsPC"
}
driver = webdriver.Remote("http://127.0.0.1:4723", desired_caps)
wait = WebDriverWait(driver, 30)
print(driver.page_source)
This is the printed driver.page_source
</?xml version=”1.0″ encoding=”utf-16″?><Window AcceleratorKey=”” AccessKey=”” AutomationId=”” ClassName=”TFMAppClass” FrameworkId=”Win32″ HasKeyboardFocus=”False” HelpText=”” IsContentElement=”True” IsControlElement=”True” IsEnabled=”True” IsKeyboardFocusable=”True” IsOffscreen=”True” IsPassword=”False” IsRequiredForForm=”False” ItemStatus=”” ItemType=”” LocalizedControlType=”window” Name=”Form1″ Orientation=”None” ProcessId=”5040″ RuntimeId=”42.330834″ x=”0″ y=”0″ width=”0″ height=”0″ CanMaximize=”False” CanMinimize=”True” IsModal=”False” WindowVisualState=”Normal” WindowInteractionState=”ReadyForUserInteraction” IsTopmost=”False” IsAvailable=”True” //>
I’ve added a couple random characters to the xml output, because I couldn’t get stackoverflow to display it well otherwise.
The problem with this output is that my test application executable contains a TButton
and a TEdit
, but they don’t seem to show up in the output.
What I also find weird about the output is that FrameworkId
is Win32
even though the application is 64-bit.
I looked up if I maybe need to add some accessibility info somehow. Based on this:
https://docwiki.embarcadero.com/RADStudio/Athens/en/FireMonkey_Accessibility_Package it seems like that’s not the case.
I also find it interesting it is able to find the form and the its name, but not the controls.
Relevant version info
- Windows 11
- Delphi 12
- Appium-Python-Client 1.3.0
- selenium 3.141.0
I also tried a vcl app btw, same result. But if I try the calculator Windows calculator app for example it does work, I can see all the controls in the page_source
.
Do fmx and vcl apps just not support what I’m trying to do? Couldn’t find anywhere that it doesn’t.