To be more clear the position of CA-2007-00002 was first and now its in 3rd place.
Now my problem is how can i identify CA-2007-00002 as its position is changing.
when i try to identify the object for CA-2007-00002 it shows as 'ctl00_cphMainContent_ctl00_gvMyCases_ctl02_lnkEdi tCase'
and its the same for E-2008-00007,as it has taken the place where CA-2007-00002 was earlier.
But i want to find a way where it can click on only CA-2007-00002 no matter where its position is.
Okay... we don't have the exact same issue but the problem is similar.
In our eCommerce application, we have to find a quantity box to enter a quantity for a transaction. We then need to find the associated "Add to Cart" button that goes along with that item. But, the description isn't easily visible in the objects so we have to go looking for it. Here's what we ended up with:
if POS('ViewCart.aspx',ParentPage.URL) <> 0 then begin
ParentPage.Document.all.ctl00_ContentPlaceHolder_C art_ContinueShoppingFlexButton_ContinueShoppingFle xButton.Click;
W1 := ParentPage.Page(ParentPage.Url);
//First we find the object where the inner text of the object is the description of the item we're looking for
lChildObj := W1.FindChild('innertext',ItemDesc,3);
//Then we find the id of the quantity box. That's that ctl100_content blah blah blah stuff
lBoxObjName := lChildObj.children.Item(0).id;
lBoxObj := Evaluate('W1.document.all.'+lBoxObjName);
//Because the quantity box, item description, and add button are all part of the same container on the store, there is a "root" to their ID that is the same for all those objects. The next few lines find that root.
lRootStringEnd := POS('01_QuantityTextBox',lBoxObjName);
lRootString := Copy(lBoxObjName,1,lRootStringEnd-1);
//We then use that root to find the flexbutton and use the evaluate function to generate our object handle
lButtonObj := Evaluate('W1.document.all.'+lRootString + '02_AddToCartFlexButton_AddToCartFlexButton');
Result := POS('ViewCart.aspx',ParentPage.URL) <> 0;
A little convoluted, yes, but this might be what you end up having to do, in a way, with your dilema.
Automated Testing Evangelists
Definition expert - noun - Unknown drip under pressure