Forum Discussion
The reason I said to do this,
let headerItems = headerInputs.FindAll('type','*',5000);
Log.Message("Number of items: " & UBound(headerItems))
Is so that I can see the number of items being returned by the FindAll method, without performing toArray.
Is there any object called 'type'?
The example that I provided, searches for this (ObjectType = Button) -
For reference, use any object name as shown in green, followed by a matching property value as shown in orange
- pkudrys13 days agoFrequent Contributor
Yes, there definitely is "Type" property in the found element. In fact, each of the elements, if inspected with Spy, have Type property. And I also tried other properties, unfortunately, with he same result.
- pkudrys13 days agoFrequent Contributor
Just tried FindAll with Enabled=True. The same result.
- rraghvani13 days ago
Champion Level 3
Could you create a new project and select JavaScript as the language (or convert the code and use VBScript). Using Chrome, navigate to https://www.w3schools.com/css/css3_buttons.asp and run the following code,
function GetAllButtons() { var browser = Sys.Browser("chrome"); var page = browser.Page("https://www.w3schools.com/css/css3_buttons.asp").Panel(2).Panel(0).Panel("belowtopnav").Panel(0).Panel("main"); var buttons = page.FindAll("ObjectType", "Button", 1); Log.Message(`Number of buttons on page ${buttons.length}`); }
Does it work, and does it return 56 buttons? I just want to eliminate and ensure that FindAll method is working as expected, before proceeding to the next step.
- pkudrys13 days agoFrequent Contributor
So, what happens is, that your code works, as expected. However, it fails in case there is used an Alias element as a parameter.
It seems to me as a TC problem? Or is there another way how to get an array of items from an alias element, whose xpath points to multiple elements?