Best Python code snippet using SeleniumBase
robo_navegador.py
Source:robo_navegador.py
...50 else:51 self.site.click(xpath='//*[@id="licensingTable"]/form/div[3]/input[7]')52 self.site.type(ritmista.num_doc, xpath='//*[@id="licensingTable"]/form/div[3]/input[8]')53 self.site.driver.find_element_by_xpath('//*[@id="l_Up_Doc_File"]').click()54 selecionar_arquivo(nome_foto=ritmista.arquivo_doc, nome_pasta='arquivos_documentos', vez=self.contador)55 self.site.type(ritmista.faculdade, xpath='//*[@id="licensingTable"]/form/div[3]/input[10]')56 self.site.type(ritmista.curso, xpath='//*[@id="licensingTable"]/form/div[3]/input[11]')57 self.site.type(ritmista.nusp, xpath='//*[@id="licensingTable"]/form/div[3]/input[12]')58 self.site.driver.find_element_by_xpath('//*[@id="l_Up_Ra_File"]').click()59 selecionar_arquivo(nome_foto=ritmista.comprovante)60 self.site.click(xpath='//*[@id="licensingTable"]/form/div[3]/button')61 self.contador += 162 print(f'\033[1;31m{ritmista.nome} cadastrado(a) com sucesso!\033[m\n')63def selecionar_arquivo(nome_foto, vez=1, nome_pasta=None):64 print(f' Selecionando arquivo {nome_foto}...')65 teclado = Controller()66 if vez == 0:67 teclado.type('PycharmProjects')68 teclado.press(Key.enter)69 teclado.release(Key.enter)70 sleep(1)71 teclado.type('credenciamento')72 teclado.press(Key.enter)73 teclado.release(Key.enter)74 sleep(1)75 teclado.type('credenciamento-tabu-arquivos')76 teclado.press(Key.enter)77 teclado.release(Key.enter)...
23 - Image Viewer With FileChooserIconView and FileChooserListView.py
Source:23 - Image Viewer With FileChooserIconView and FileChooserListView.py
...39 text: "Selecionar Arquivo"40 font_size: 2541 size_hint: (0.3, 0.1)42 pos_hint: {"x":.7, "bottom":1}43 on_press: app.root.selecionar_arquivo()44 """)45 def selected(self, filename):46 try:47 self.ids.my_image.source = filename[0]48 # print(filename[0])49 except:50 pass5152 def selecionar_arquivo(self):53 print(self.ids.my_image.source)545556class AwesomeApp(MDApp):57 def build(self):58 self.theme_cls.theme_style = 'Dark'59 return MyLayout()606162if __name__ == '__main__':
...
Upload.py
Source:Upload.py
...16 "serviceAccount": "serviceAccountKey.json"17}18class UploadScreen(Screen):19 EnvEp = ObjectProperty(None)20 def selecionar_arquivo():21 janela_padrao = Tk().withdraw()22 caminho_do_arquivo = askopenfilename(filetypes=(("Arquivos de audio", "*.mp3"), ('Todos os arquivos', '*.*')))23 caminho_do_arquivo = Path(caminho_do_arquivo)24 if caminho_do_arquivo:25 print(caminho_do_arquivo)26 return caminho_do_arquivo27 else:28 print("Nenhum arquivo selecionado")29 def get_arquivo(dir):30 with os.scandir(dir) as entrie:31 yield entry32 pass33 def post_arquivo(self):34 #dirpath = UploadScreen.selecionar_arquivo()35 firebase_storage = pyrebase.initialize_app(config)36 storage = firebase_storage.storage()...
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!!