Best Python code snippet using SeleniumBase
Calculadora.py
Source:Calculadora.py
...49 def operacion(self):50 if (self.sender().text() == "="):51 pass52 elif (self.sender().text() == "DEL"):53 self.actualizar_texto(self.guardados[:-1])54 self.guardados = self.guardados[:-1]55 elif (self.sender().text() == "C"):56 self.borrar_texto()57 elif (self.sender().text() == "x"):58 self.guardados += "*"59 self.actualizar_texto(self.guardados)60 elif (self.sender().text() == "()"):61 if(self.comprovar_parentesis):62 self.guardados += "("63 self.comprovar_parentesis = False64 self.actualizar_texto(self.guardados)65 elif(not self.comprovar_parentesis):66 self.guardados += ")"67 self.comprovar_parentesis = True68 self.actualizar_texto(self.guardados)69 else:70 self.guardados += self.sender().text()71 self.actualizar_texto(self.guardados)72 # Borra el Strin/Texto que se muestra en la ventana73 def borrar_texto(self):74 self.actualizar_texto("")75 self.guardados = ""76 # Calcula la operacion guardada en el String "guardados" con el metodo eval77 def resultado(self):78 self.actualizar_texto(str(eval(self.guardados)))79 # Actualiza el texto que se muestra por pantalla80 def actualizar_texto(self, text):81 self.ventana.setText(text)82 self.ventana.setFocus()83app = QApplication(sys.argv)84window = MainWindow()85window.show()...
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!!