Is there anything we can do about “The UiElement is no longer valid” error?
I am using a software application written on .Net framework. UiPath Studio can pick up most elements.
I am trying to Type Into a textbox. This Textbox’s element can be picked up using Indicate Element inside window, and I adjusted the selector so it can be used for all transactions.
Now the weird part is, when I run the program, the first transaction always fails when trying to Type Into, with the error message The UiElement is no longer valid even though the TextBox is right there and visible.
When I close the application and check the selector, it says “Valid”, so the selector seems fine. What is even more weird is, the first transaction always fails, but after the second transaction, it works fine.
Why does this happen? Is there any way to fix this?
Seems to be something with the selector @tomato25.
Did you try UiExplorer for selectors?
Did you try identifying difference in the selector while its a first run, and then consecutive runs?
I had trouble when I was including IDX in a selector.
It could be different scenario for you, but I was trying to automate FileZilla, and the IDX was a blocker. After every upload, the IDX would change randomly. I was not able to automate using FileZilla and had to use an alternate way.
Yes, IDX could be a very important identifier.
@tomato25
First, get the selector before first run, also get attribute values - like of IDX.
Second, perform the first run manually.
Now, get the selector again, and the attribute values - like of IDX.
Actually, I figured it out now.
I was thinking what could be different between the first run and after the first run, then I thought that maybe the elements haven’t been ready during the first run.
I just added Delay of 10 seconds only during the first transaction, and it fixed the problem!
The tricky part was, I had already tried using Delay, but it didn’t work because it was too short!
I already tried with Delay of 3-5 seconds before Type Into, but it didn’t work.
I just increased it to 10 seconds, and it started working…