Do until condition for AI

I'm dropping an object on a canvas, then I want to assure that the drag and drop worked, using the following Do Until.  It does not work, it continues to drag/drop the object. What am I doing wrong?  Thanks for any help rendered.

Do Until AIUtil.FindTextBlock("Form 3C:", micFromBottom, 1).Exists
Browser("Architect: Architect Applicati").Page("Architect: Architect Applicati_66").WebElement("Form 3C: Ineligible").Drag
Browser("Architect: Architect Applicati").Page("Architect: Architect Applicati_47").WebElement("Canvas").Drop 629,420
Loop

  • 0  

    the possible reason being the object couldn't be found. you may try to find it with the script you have, AIUtil.FindTextBlock("Form 3C:", micFromBottom, 1).Exists, after the box is dropped manually. or, after dropping the element, the picture taken by UFT doesn't have the block yet. then, add a wait statement inside the loop after drop, making sure the block is steady before the next look-up. 

  • Suggested Answer

    0  

    Hello  ,

    You're code block should look like this instead:

    Do

    Browser("Architect: Architect Applicati").Page("Architect: Architect Applicati_66").WebElement("Form 3C: Ineligible").Drag
    Browser("Architect: Architect Applicati").Page("Architect: Architect Applicati_47").WebElement("Canvas").Drop 629,420

    Loop Until AIUtil.FindTextBlock("Form 3C:", micFromBottom, 1).Exists