I don't suppose many are using Winium.Cruciatus or the Winium.Desktop WebDriver implementation but if anyone is maybe you can help or benefit from my workaround.
I use the WebDriver implementation to start my application, something like this:
capabilities = { 'app' => path, 'launchDelay' => 1500 }
driver = Selenium::WebDriver.for(:remote,
url: 'http://127.0.0.1:9999',
desired_capabilities: capabilities)
The application starts just fine but I need to find the root element to be able to find children without scouring the entire automation tree every time.
I used to do this:
wait.until { @driver.find_element(:id, 'appid') }
Which works fine if the application is loaded and if there's not too many windows open. However, when I've got like 10-15 windows open and the application takes a few seconds to start the cruciatus library just hangs. I've tracked this down to the automation library itself, it hangs. I think this is due to the application not having been loaded when the library peruses the element tree and it starts going through each and every element in the scope which takes ages and probably ends in a stack overflow in the end (according to MSDN).
I've even tried fixing the Cruciatus implementation myself but since this is an inherent issue in the slowness of enumerating elements it didn't really help even if I put in a timeout in Cruciatus.
I'll provide my workaround as an answer but if anyone has a better suggestion it would be much appreciated?
Aucun commentaire:
Enregistrer un commentaire