def writeToFile_variables(object, obj, sf_type): # MSuccess_Msg = Message(bottom_frame, text='Printing file ....') # def Error_Delete(): # error_Msg.destroy() # Try_with_Other_object_btn.destroy() # Try_with_Other_object_btn = Button(bottom_frame, text="Try_with_Other_object", fg="black", bg="light blue", # command=Error_Delete) # Try_with_Other_object_btn.grid(row=2, column=2) OS = OperatingSystem() # path = '../Resources/MedvantageApp/PageElements/%s_Page.robot' % object OS.append_to_file(path, '*** Variables ***') OS.append_to_file(path, '\n') # MSuccess_Msg.grid(row=0, column=1) print 'Printing file ....' # if sf_type is 'classic': # OS.append_to_file(path, '\n''# Locators for All Tabs') # OS.append_to_file(path, '\n''${Alltabs_btn_loc} //img[@title=\'All Tabs\']') # OS.append_to_file(path, '\n''${%s_tab_link_loc} //img[@title=\'%s\']'%(object,obj)) # OS.append_to_file(path, '\n') # elif sf_type is 'lightning': # OS.append_to_file(path, '\n''# Locators for All Items(Tabs)') # OS.append_to_file(path, '\n''${All_App_Launcher_loc} //img[@title=\'All Tabs\']') # OS.append_to_file(path, '\n''${%s_tab_link_loc} //img[@title=\'%s\']' % (object, obj)) # OS.append_to_file(path, '\n') try: for xpathdata in xpath_values: OS.append_to_file(path, xpathdata) OS.append_to_file(path, '\n') except: print "No Object" writeToFile_keywords(object, obj, sf_type)
def writeToFile_Settings(object, obj, sf_type): global OS, path OS = OperatingSystem() path = '../../Resources/MedvantageApp/PO/%s_Page_%s.robot' % (object, sf_type) OS.create_file(path, '*** Settings ***') print 'Printing Settings ....' OS.append_to_file(path, '\n') OS.append_to_file(path, 'Documentation %s Page Reusable Keywords' % object) OS.append_to_file(path, '\n') OS.append_to_file(path, 'Library Selenium2Library') OS.append_to_file(path, '\n') OS.append_to_file(path, 'Library OperatingSystem') OS.append_to_file(path, '\n') # OS.append_to_file(path, 'Library ../../common-variables.robot') OS.append_to_file(path, '\n') OS.append_to_file(path, 'Resource ../../common-methods.robot') OS.append_to_file(path, '\n') OS.append_to_file(path, 'Library ../../../Library/Libs/datepicker.py') OS.append_to_file(path, '\n') OS.append_to_file(path, '\n') writeToFile_variables(object, obj, sf_type)
def writeToFile_Settings(object, obj): global OS, path OS = OperatingSystem() path = '../Resources/MedvantageApp/PO/%s_Page.robot' % object OS.create_file(path, '*** Settings ***') print 'Printing Settings ....' OS.append_to_file(path, '\n') OS.append_to_file(path, 'Documentation %s Page Reusable Keywords' % object) OS.append_to_file(path, '\n') OS.append_to_file(path, 'Library Selenium2Library') OS.append_to_file(path, '\n') OS.append_to_file(path, 'Library OperatingSystem') OS.append_to_file(path, '\n') OS.append_to_file(path, 'Library ../../../Utility/keyword_generator.py') OS.append_to_file(path, '\n') OS.append_to_file(path, 'Resource ../../commonn-methods.robot') OS.append_to_file(path, '\n') OS.append_to_file(path, 'Library ../../../Utility/NameDatetime.py') OS.append_to_file(path, '\n') OS.append_to_file(path, '\n') writeToFile_variables(object, obj)