The element does not support the required capability 'table'
Posted: Wed Apr 01, 2015 9:57 pm
I get this error in my custom code. I'm trying to search through a table in my application to determine in which row the data is that I want to change.
The table has several columns and multiple rows for the same product. I need to find the row where the product has a specific value. For instance, which product is sold out.
Here is the code I'm using:
public void SelectOrder()
{
//Table varTable = "/dom[@domain='qa.xxx.sss.com']//div[#'content']/div[2]/div[2]/div[1]/div/div/div/div/div/table/tbody[2]/";
//Table varTable = "/dom[@caption=Shopping]//div[#'content']/div[2]/div[2]/div[1]/div/div/div/div/div/table/tbody[2]/";
Table varTable = "/dom[@caption=Shopping]//div[#'content']/div[2]/div[2]/div[1]/div/div/";
var varRows = varTable.Rows;
foreach (var row in varRows)
{
var varProduct = "tr["+row+"]/td[@innertext]";
if(varProduct == "Rice")
{
var varStatus = "tr["+row+"]/td[@innertext]";
if (varStatus == "Sold Out")
{
tableRowNum = row.ToString();
}
}
}
}//end SelectOrder function
I tried all three versions of the table item definitions above and they all throw the same error. How should I specify the table?
The table has several columns and multiple rows for the same product. I need to find the row where the product has a specific value. For instance, which product is sold out.
Here is the code I'm using:
public void SelectOrder()
{
//Table varTable = "/dom[@domain='qa.xxx.sss.com']//div[#'content']/div[2]/div[2]/div[1]/div/div/div/div/div/table/tbody[2]/";
//Table varTable = "/dom[@caption=Shopping]//div[#'content']/div[2]/div[2]/div[1]/div/div/div/div/div/table/tbody[2]/";
Table varTable = "/dom[@caption=Shopping]//div[#'content']/div[2]/div[2]/div[1]/div/div/";
var varRows = varTable.Rows;
foreach (var row in varRows)
{
var varProduct = "tr["+row+"]/td[@innertext]";
if(varProduct == "Rice")
{
var varStatus = "tr["+row+"]/td[@innertext]";
if (varStatus == "Sold Out")
{
tableRowNum = row.ToString();
}
}
}
}//end SelectOrder function
I tried all three versions of the table item definitions above and they all throw the same error. How should I specify the table?