Menu not selected as TC reports as not visible on screen, but i'm looking right at it.
Bit of an unusual one here and i'm very confused.
The below code is run and searches for and selects the menu item detailed.
The code is used several times in a loop to build a system, so it searches and selects, 'Color', 'Projection', Wall Height' etc.
Oddly on the 7th and 8th loop system it builds, it searches for 'Flooring' finds it, but then can't select it as it reports it is waiting for it to be visible on screen.
What is strange is that i can see it on screen, it knows it is there as it fails at the touch command, using the object spy reports it as being visible on screen, but for some reason the Watch details for it show as False for Visible on screen.
Of the 16 systems it builds it is fine for all the rest
procedure Find_Label_Touch(ControlName : String; Driver: OleVariant); var target_CollectionView; target_Label; Value; begin Value := Project.Variables.Driver.Value(ControlName); If Value <> 'Blank' then begin target_CollectionView := Aliases.Device.processApplication.window0.tableview0; target_Label := target_CollectionView.Find( ['ObjectType', 'ObjectText'], ['Label', Value], 20000); target_Label.Touch(); Delay(500); end; end;
Thank you both and apologies for the late feedback.
I have a feeling that it is some sort of delay in the screen displaying what it is looking for although i am not sure why it is only affecting that particular menu item, since they all run the same code, just with a different param to tell it what text to search for. I have increased my delays in the script and it appears to now be fine for 15 out of 16 loops.
Thank you both for the input as it gave me other avenues to look at.