我正在尝试找到一个显示单击的锚点。计算所有元素并使用isDisplayed()不是最佳的。有更快,更有效的方法吗?
答案 0 :(得分:0)
假设你的主要元素是:
public boolean isPresent(WebElement element){
try{
elem ;
return true;
}
catch(Exception e){
return false;
}
}
或者,要验证是否显示此元素,您可以使用自定义方法:
SELECT
dbo.RtlStore.Description,
COUNT(dbo.InvProduct.U_OwnershipType) AS CONSIGNMENT,
COUNT(dbo.InvProduct.U_OwnershipType) AS OUTRIGHT,
COUNT(dbo.InvProduct.U_OwnershipType) AS HOURSEBRAND,
COUNT(dbo.InvProduct.U_OwnershipType) AS GOI,
COUNT(dbo.InvProduct.U_OwnershipType) AS OTHERS
FROM
dbo.RtlStore
LEFT OUTER JOIN
dbo.InvProduct
LEFT OUTER JOIN
dbo.TrxTransactionSaleItem ON dbo.InvProduct.ProductKey = dbo.TrxTransactionSaleItem.ProductKey
LEFT OUTER JOIN
dbo.TrxTransaction ON dbo.TrxTransactionSaleItem.TransactionKey = dbo.TrxTransaction.TransactionKey
ON dbo.RtlStore.StoreKey = dbo.TrxTransaction.StoreKey
GROUP BY
dbo.RtlStore.Description
HAVING
(COUNT(dbo.InvProduct.U_OwnershipType) = N'CONSIGNMENT')
AND (COUNT(dbo.InvProduct.U_OwnershipType) = N'OUTRIGHT')
AND (COUNT(dbo.InvProduct.U_OwnershipType) = N'HOUSEBRAND')
AND (COUNT(dbo.InvProduct.U_OwnershipType) = N'GOI')
AND (COUNT(dbo.InvProduct.U_OwnershipType) = N'OTHERS')