Getting the count of elements on the page
Hi there,
I am trying to get the count of this object from the webpage and run the loop. The Count is returning null for me when I inspect in the console I have around 9. Also for this FindElements when I try to use the library functions its taking for ever to load and shows only spin.
Source code
2nd option
var TestedPage, CSSSelector
CSSSelector = "button[title='More options']"
TestedPage = NameMapping.Sys.browser.pageRavenCore.FindElements("//div[@data-testid='canvasItem']")
if I use TestedPage.QuerySelector(CSSSelector) I am getting the following error.
3rd option
for the following script I was able to get the object but still when I say object.Count its returning empty
var res;
Aliases.canvas_card_Item
res= Aliases.canvas_card_Item.FindElements("button[title='More options']");
// Check the result
if (!strictEqual(res, null))
// If the element was found, output its HTML code
Log.Message(res.Count);
else
// If the element was not found, post a warning to the log
Log.Warning("The element was not found.");
4th option
var TestedPage
TestedPage = NameMapping.Sys.browser.pageRavenCore.FindElements("//div[@data-testid='canvasItem']")
TestedPage.Count
Log.Message("canvasCard selector "+ TestedPage.Count) It printed undefined