Forum Discussion
tristaanogre
13 years agoEsteemed Contributor
The problem is that you have MANY orders all with the same label, "Test 1". You're then using a method, FindChild, that will find one item with the matching criteria. Usually, it will return the first of many items.
If your intent is to go down the list and click on each order, one at a time, and close the resulting window, your better code would be to use FindAllChildren which will return all links in the table in an array that you can then iterate through with a for loop.
Code below is untested, but this SHOULD give you wnat you want.
If your intent is to go down the list and click on each order, one at a time, and close the resulting window, your better code would be to use FindAllChildren which will return all links in the table in an array that you can then iterate through with a for loop.
Code below is untested, but this SHOULD give you wnat you want.
function orderdetails(y)
{
var j;
order = Aliases.IEXPLORE.pageCustomerorderdetails.panelCtl00MG8b2deec601ca48898630_1.tableCtl00MG8b2deec601ca48898630;
var ordercount = order.RowCount-1;
Log.Message(ordercount);
var PropArray, ValuesArray, w;
PropArray = new Array("innerText");
ValuesArray = new Array("Test 1");
var LinkArray = order.FindAllChildren(PropArray, ValuesArray, 5);
LinkArray = (new VBArray(LinkArray)).toArray();
var LinkIndex;
for(LinkIndex=0;LinkIndex<LinkArray.length;LinkIndex++)
{
Log.Message(LinkIndex+1);
Log.Message(y);
Log.Message(LinkArray[LinkIndex].innerText);
LinkArray[LinkIndex].Click();
Aliases.IEXPLORE.pageCustomerorderdetails.linkClose.Click();
Delay(3000);
}
}
Related Content
- 11 months agoIrinaManea
- 12 months agoMarcusBengtsson
- 10 months agoAnabelle
Recent Discussions
- 9 hours agoMW_Didata