Mixing code WiniumDriver and Recorder

Is it possible to mix the code generated by the Windows Recorder with your own code?
As soon as I try to mix something winappdriver does not find the elements anymore

Example (the same action twice. but is to be interwoven):
WiniumDriver driver = null
String appPath = ‘C:/Windows/System32/notepad.exe’

DesktopOptions option = new DesktopOptions()
option.setApplicationPath(appPath)
option.setDebugConnectToRunningApp(false)
option.setLaunchDelay(2)

driver = new WiniumDriver(new URL(‘http://127.0.0.1:4723’), option)
WebElement textEditor = driver.findElement(By.name(“Text-Editor”)).sendKeys(“Test”)
driver.findElement(By.name(“Schließen”)).click()
driver.findElement(By.name(“Nicht speichern”)).click()

Windows.startApplicationWithTitle(‘C:\Windows\notepad.exe’, ‘’)
Windows.setText(findWindowsObject(‘Object Repository/Edit’), ‘Test’)
Windows.click(findWindowsObject(‘Object Repository/Button’))
Windows.click(findWindowsObject(‘Object Repository/Button(1)’))


but this one does not run
WiniumDriver driver = null
String appPath = ‘C:/Windows/System32/notepad.exe’

DesktopOptions option = new DesktopOptions()
option.setApplicationPath(appPath)
option.setDebugConnectToRunningApp(false)
option.setLaunchDelay(2)

driver = new WiniumDriver(new URL(‘http://127.0.0.1:4723’), option)

Windows.setText(findWindowsObject(‘Object Repository/Edit’), ‘Test’)
Windows.click(findWindowsObject(‘Object Repository/Button’))
Windows.click(findWindowsObject(‘Object Repository/Button(1)’))

Is there a way to parse the Windows objects into the driver?

Hi,

I do not 100% understand your point and not really familiar with WiniumDriver.
But maybe hope my questions can help others get more information.

Why do you have 2 version of codes? And why do the second code not start application before you setText (maybe this is why the second one does not run)?

Thanks for the help

you are right. the problem we had was a splash screen in the software.

but the splash screen can be set with the option project → settings → desired capabilities → windows with the entry: ms:waitForAppLaunch and then the project must be started like this:

grafik