Best Python code snippet using fMBT_python
fmbtwindows.py
Source:fmbtwindows.py  
...527        """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)):536                  coordinates that fall in the bounding box of found items.537          other parameters: refer to findItems documentation.538        Items are listed in ascending order based on area. They may539        or may not be from the same branch in the widget hierarchy.540        """541        x, y = self._intCoords(pos)542        c = lambda item: (item.bbox()[0] <= x <= item.bbox()[2] and item.bbox()[1] <= y <= item.bbox()[3])543        items = self.findItems(c, count=count, searchRootItem=searchRootItem, searchItems=searchItems, onScreen=onScreen)544        # sort from smallest to greatest area545        area_items = [((i.bbox()[2] - i.bbox()[0]) * (i.bbox()[3] - i.bbox()[1]), i) for i in items]...fmbtx11.py
Source:fmbtx11.py  
...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 may205        or may not be from the same branch in the widget hierarchy.206        """207        x, y = self._intCoords(pos)208        c = lambda item: (item.bbox()[0] <= x <= item.bbox()[2] and item.bbox()[1] <= y <= item.bbox()[3])209        items = self.findItems(c, count=count, searchRootItem=searchRootItem, searchItems=searchItems, onScreen=onScreen)210        # sort from smallest to greatest area211        area_items = [((i.bbox()[2] - i.bbox()[0]) * (i.bbox()[3] - i.bbox()[1]), i) for i in items]...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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
