Best Python code snippet using SeleniumBase
main.py
Source: main.py
...67 """ Choose a product substitute and save in the data base """68 if int(choices) <= len(products):69 # propose a better susbstitution prouct for the product chosen70 substitute_propostion(choices)71 save_presentation()72 choice = input("\nVotre choix : ")73 if choice == "1":74 id_substitut = input("Entrer l'ID du substitut afin de l'enregistrer: ")75 save.save_menu(choices, id_substitut)76 main()77 elif choice == "2":78 print('\n ------------------ Choisissez une categories -------------------')79 categories = db.show_category()80 categories_id = []81 for _id, category in categories:82 categories_id.append(str(_id))83 print(_id, "-", category)84 category_menu(categories_id)85 elif choice == "3":...
pp_maker.py
Source: pp_maker.py
...37 track_slide(prs, round_num, track_num)38 review_slide(prs, round_num, num_tracks)39 answer_slide(prs, answer_sheet, round_num, num_tracks, challenge_round)40 # Save the Presentation41 save_presentation(prs)42if __name__ == '__main__':43 print('\n\033[92mRunning vgmc_pp_maker.py\033[0m')44 try:45 main()46 except Exception as e:...
src.py
Source: src.py
...4import pandas as pd5from pptx import Presentation6def read_presentation(path):7 return Presentation(path)8def save_presentation(prs, path):9 prs.save(path)10def read_data(path):11 df = pd.read_excel(path)12 return df13 14 15def replace_text_retaining_initial_formatting(shape, new_text):16 paragraph = shape.text_frame.paragraphs[0]17 p = paragraph._p # the lxml element containing the `<a:p>` paragraph element18 # remove all but the first run19 for idx, run in enumerate(paragraph.runs):20 if idx == 0:21 continue22 p.remove(run._r)23 paragraph.runs[0].text = new_text24 25def duplicate_slide(pres, index):26 template = pres.slides[index]27 blank_slide_layout = pres.slide_layouts[0]28 copied_slide = pres.slides.add_slide(blank_slide_layout)29 30 # remove empty shapes from slide master31 for shp in copied_slide.shapes:32 if shp.text == '':33 sp = shp._sp34 sp.getparent().remove(sp)35 for shp in template.shapes:36 el = shp.element37 newel = copy.deepcopy(el)38 copied_slide.shapes._spTree.insert_element_before(newel, 'p:extLst')39 40 return copied_slide41def fill_pres_with_data(pres, data):42 prs = copy.deepcopy(pres)43 for index, row in data.iterrows():44 slide = duplicate_slide(prs, 0)45 for shape in slide.shapes:46 try:47 replace_text_retaining_initial_formatting(shape, row[shape.text])48 except Exception as e:49 pass50 #print(e)51 return prs52 53def fill_sep_pres_with_data(pres, data, path):54 for index, row in data.iterrows():55 prs = copy.deepcopy(pres)56 slide = prs.slides[0]57 #slide = duplicate_slide(prs, 0)58 for shape in slide.shapes:59 try:60 replace_text_retaining_initial_formatting(shape, row[shape.text])61 except Exception as e:62 pass63 #print(e)64 save_presentation(prs, os.path.join(path, f'{index}.pptx'))65 return pres66 67 68def save_files_as_zip(dir_name, zip_name):...
Check out the latest blogs from LambdaTest on this topic:
Entering the world of testers, one question started to formulate in my mind: “what is the reason that bugs happen?”.
When I started writing tests with Cypress, I was always going to use the user interface to interact and change the application’s state when running tests.
The rapid shift in the use of technology has impacted testing and quality assurance significantly, especially around the cloud adoption of agile development methodologies. With this, the increasing importance of quality and automation testing has risen enough to deliver quality work.
ChatGPT broke all Internet records by going viral in the first week of its launch. A million users in 5 days are unprecedented. A conversational AI that can answer natural language-based questions and create poems, write movie scripts, write social media posts, write descriptive essays, and do tons of amazing things. Our first thought when we got access to the platform was how to use this amazing platform to make the lives of web and mobile app testers easier. And most importantly, how we can use ChatGPT for automated testing.
As a developer, checking the cross browser compatibility of your CSS properties is of utmost importance when building your website. I have often found myself excited to use a CSS feature only to discover that it’s still not supported on all browsers. Even if it is supported, the feature might be experimental and not work consistently across all browsers. Ask any front-end developer about using a CSS feature whose support is still in the experimental phase in most prominent web browsers. ????
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!!