Best Python code snippet using fMBT_python
fmbtgti.py
Source:fmbtgti.py
...1825 e4gImage = eye4graphics.openImage(self._filename)1826 self._screenSize = _e4gImageDimensions(e4gImage)1827 eye4graphics.closeImage(e4gImage)1828 return self._screenSize1829 def _notifyOcrEngine(self):1830 if self._ocrEngine and not self._ocrEngineNotified:1831 self._ocrEngine.addScreenshot(self)1832 self._ocrEngineNotified = True1833 if id(self._ocrEngine) == id(self._oirEngine):1834 self._oirEngineNotified = True1835 def _notifyOirEngine(self):1836 if self._oirEngine and not self._oirEngineNotified:1837 self._oirEngine.addScreenshot(self)1838 self._oirEngineNotified = True1839 if id(self._oirEngine) == id(self._ocrEngine):1840 self._ocrEngineNotified = True1841 def dumpOcr(self, **kwargs):1842 """1843 Return what OCR engine recognizes on this screenshot.1844 Not all OCR engines provide this functionality.1845 """1846 self._notifyOcrEngine()1847 return self._ocrEngine.dumpOcr(self, **kwargs)1848 def dumpOcrWords(self, **kwargs):1849 """1850 Deprecated, use dumpOcr().1851 """1852 return self.dumpOcr(**kwargs)1853 def filename(self):1854 return self._filename1855 def findItemsByBitmap(self, bitmap, **oirFindArgs):1856 if self._oirEngine != None:1857 self._notifyOirEngine()1858 oirArgsList = self._paths.oirArgsList(bitmap)1859 results = []1860 if oirArgsList:1861 for oirArgs in oirArgsList:1862 oirArgs, _ = _takeOirArgs(self._oirEngine, oirArgs.copy())1863 oirArgs.update(oirFindArgs)1864 results.extend(self._oirEngine.findBitmap(1865 self, self._paths.abspath(bitmap), **oirArgs))1866 if results: break1867 else:1868 oirArgs = oirFindArgs1869 results.extend(self._oirEngine.findBitmap(1870 self, self._paths.abspath(bitmap), **oirArgs))1871 return results1872 else:1873 raise RuntimeError('Trying to use OIR on "%s" without OIR engine.' % (self.filename(),))1874 def findItemsByOcr(self, text, **ocrEngineArgs):1875 if self._ocrEngine != None:1876 self._notifyOcrEngine()1877 return self._ocrEngine.findText(self, text, **ocrEngineArgs)1878 else:1879 raise RuntimeError('Trying to use OCR on "%s" without OCR engine.' % (self.filename(),))1880 def save(self, fileOrDirName):1881 shutil.copy(self._filename, fileOrDirName)1882 def ocrEngine(self):1883 return self._ocrEngine1884 def oirEngine(self):1885 return self._oirEngine1886 def __str__(self):1887 return 'Screenshot(filename="%s")' % (self._filename,)1888class GUIItem(object):1889 """1890 GUIItem holds the information of a single GUI item....
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!!