How to use findItemsByProperties method in fMBT

Best Python code snippet using fMBT_python

fmbtwindows.py

Source:fmbtwindows.py Github

copy

Full Screen

...510 return self.findItems(c, count=count, searchRootItem=searchRootItem, searchItems=searchItems, onScreen=onScreen)511 def findItemsById(self, itemId, count=-1, searchRootItem=None, searchItems=None, onScreen=False):512 c = lambda item: (itemId == item._itemId or itemId == item.properties().get("AutomationId", None))513 return self.findItems(c, count=count, searchRootItem=searchRootItem, searchItems=searchItems, onScreen=onScreen)514 def findItemsByProperties(self, properties, count=-1, searchRootItem=None, searchItems=None, onScreen=False):515 """516 Returns ViewItems where every property matches given properties517 Parameters:518 properties (dictionary):519 names and required values of properties520 Example:521 view.findItemsByProperties({"Value": "HELLO", "Name": "File name:"})522 See also:523 viewitem.dumpProperties()524 Notes:525 - requires uiautomation (refreshView(viewSource="uiautomation"))526 - all names and values are strings527 """528 c = lambda item: 0 == len([key for key in properties529 if properties[key] != item.properties().get(key, None)])530 return self.findItems(c, count=count, searchRootItem=searchRootItem, searchItems=searchItems, onScreen=onScreen)531 def findItemsByPos(self, pos, count=-1, searchRootItem=None, searchItems=None, onScreen=False):532 """533 Returns list of ViewItems whose bounding box contains the position.534 Parameters:535 pos (pair of floats (0.0..0.1) or integers (x, y)):...

Full Screen

Full Screen

fmbtx11.py

Source:fmbtx11.py Github

copy

Full Screen

...179 return self.findItems(c, count=count, searchRootItem=searchRootItem, searchItems=searchItems, onScreen=onScreen)180 def findItemsById(self, itemId, count=-1, searchRootItem=None, searchItems=None, onScreen=False):181 c = lambda item: (itemId == item._itemId or itemId == item.properties().get("AutomationId", None))182 return self.findItems(c, count=count, searchRootItem=searchRootItem, searchItems=searchItems, onScreen=onScreen)183 def findItemsByProperties(self, properties, count=-1, searchRootItem=None, searchItems=None, onScreen=False):184 """185 Returns ViewItems where every property matches given properties186 Parameters:187 properties (dictionary):188 names and required values of properties189 Example:190 view.findItemsByProperties({"Value": "HELLO", "Name": "File name:"})191 See also:192 viewitem.dumpProperties()193 """194 c = lambda item: 0 == len([key for key in properties195 if properties[key] != item.properties().get(key, None)])196 return self.findItems(c, count=count, searchRootItem=searchRootItem, searchItems=searchItems, onScreen=onScreen)197 def findItemsByPos(self, pos, count=-1, searchRootItem=None, searchItems=None, onScreen=False):198 """199 Returns list of ViewItems whose bounding box contains the position.200 Parameters:201 pos (pair of floats (0.0..0.1) or integers (x, y)):202 coordinates that fall in the bounding box of found items.203 other parameters: refer to findItems documentation.204 Items are listed in ascending order based on area. They may...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run fMBT automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful