In TruClient Vugen script is it possible to wait for a Button to become clickable. Currently in my script I am waiting for an object to exist, but its not very stable and some transactions keep failing because of it. Please help on the logic to wait for an element until it becomes clickable.
1 Answers
how about using TruClient Descriptors as ID method? In case the element contains indication for when it is clickable (e.g. Class, Attribute, etc.) you could use that indication for object identification. TruClient should identify the object once the attribute is set and resume.
Another option could be to create some kind of click retry mechanism in order to execute the click once the button is clickable:
Use the same "Wait for Object" step and add "For Loop" step with certain number of iteration (i.e. retries) right after.
Inside the for loop you could use the following steps:
1. Click step
2. Wait for Object (next object that should appear)
3. Catch step with "Object Identification" as argument and internal "Flow Control" - "Continue" step
4. "Flow Control" - "Break" step
In case the object is clickable, steps 2-3 should pass and step 4 would break the loop. In case the object is not clickable, step 2 should fail with object identification error which would trigger step 3 and the internal continue step in order to try the click again. You can space out the retries by adding a simple wait step inside the catch block.

- 1
- 1