Ich benutze Robot Framework.Robot Framework Download Datei
Auf meiner HTML-Seite habe ich eine einfache Schaltfläche. Wenn Sie darauf klicken, wird eine PDF-Datei heruntergeladen.
Wie kann ich mit Robot Framework überprüfen, ob die Datei heruntergeladen wurde?
Tks
fand ich eine Lösung, tks zu @ ombre42:
${SERVER} ${SERVER_DEV}
${NAME} Robot
${FILE_NAME} Robot.pdf
${CLASS_NAME} in
${DOWNLOAD_DIRECTORY} C:\\robot_download
Scenario: User can download
Create Directory ${DOWNLOAD_DIRECTORY}
${CHROME_OPTIONS}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
${disabled} Create List Chrome PDF Viewer
${prefs} Create Dictionary download.default_directory=${DOWNLOAD_DIRECTORY} plugins.plugins_disabled=${disabled}
Call Method ${CHROME_OPTIONS} add_experimental_option prefs ${prefs}
Create Webdriver Chrome chrome_options=${CHROME_OPTIONS}
Goto ${SERVER}
Click Element ${NAME}
Wait Until Element Is Visible css=div.${CLASS_NAME} 8
Page Should Contain ${NAME}
Set Selenium Speed 10s
Download PDF ${NAME}
File Should Exist C:\\robot_download\\${FILE_NAME}
Welchen Browser benutzen Sie? – ombre42
Ich verwende Chrome. – Raphael