In My present project i need to click on Add button so that textboxes will appear and we can enter value in textboxes.How ever the problem is when i click on add and trying to find out the properties of that textbox then name:=Edit and Index:=1 is counted how ever if i didnot enter anything i went out of the window and comes again to the same for clicking on add to add textbox then even thought it is the first text box it is showing as index incremented as 2.Situation arised what to pick the value for the text to enter.
If iBCount = 1 Then
Set objPage = Browser("name:=.*").Page("index:=0")
Set objPage = Browser("name:=.*","index:=0").Page("index:=0")
Set ObjDesc = Description.Create()
ObjDesc("micclass").Value = "WebEdit"
ObjLists(1).Set "Text 1"
ObjLists(2).Set "Text 2"
I've never encountered this except when I had more than one identical window/page/dialog open (usually accidentally and I didn't realize it was happening). Is there any chance that, when the index changes from 1 to 2, could there be a second dialog open behind the first one (you might not be able to see it)?
If it's not as obvious as having multiple pages open and visible to the user, it might still be a case of the code creating objects but not correctly destroying them - you mentioned "went out of the window and came back to it" so maybe it appears to you that the window and its objects no longer exist, but maybe the code is retaining those objects and that is causing the new window to instantiate its objects with a higher index. If this is the case, it sounds like a bug in the code.