diff --git a/content/press_save_button.json b/content/press_save_button.json new file mode 100644 index 0000000..d246b86 --- /dev/null +++ b/content/press_save_button.json @@ -0,0 +1,3 @@ +{ + "lable_for_save_button": "Speichern" +} \ No newline at end of file diff --git a/content/press_save_button.py b/content/press_save_button.py new file mode 100644 index 0000000..b393796 --- /dev/null +++ b/content/press_save_button.py @@ -0,0 +1,19 @@ +import json +import os +from selenium import webdriver +from selenium.webdriver.common.by import By + + +def press_save_button(driver: webdriver.firefox.webdriver.WebDriver): + string_json_path: str = os.path.join("content", "press_save_button.json") + + with open(string_json_path, "r") as file: + string_dict = json.load(file) + + # Press source code button + found_element_list = driver.find_elements(By.TAG_NAME, "button") + for i in found_element_list: + temp_str = str(i.get_dom_attribute("title")) + if temp_str.find(string_dict["lable_for_save_button"]) != -1: + i.click() + break