Requirements.txt file:
robotframework==6.1.1
robotframework-seleniumlibrary==6.3.0
robotframework-angularjs==1.0.0
robotframework-datadriver==1.11.2
robotframework-stacktrace==0.4.1
robotframework-appiumlibrary==2.1.0
robotframework-debuglibrary==2.5.0
robotframework-pythonlibcore==4.4.1
webdriver_manager==4.0.1
robotframework-pabot==2.18.0
robotframework-faker==5.0.0
robotframework-metrics==3.3.3
selenium==4.15.2
pyOpenSSL==24.1.0
PySocks==1.7.1
screen_brightness-control==0.23.0
pytz==2024.1
PyQt5==5.15.10
rpaframework==28.6.0
PyAutoGUI==0.9.54
pdf2image==1.17.0
pyzbar==0.1.9
opencv-python==4.10.0.84
numpy==2.0.0
Here’s our sample code
Suite Setup
${chromeOptions}= Evaluate sys.modules[‘selenium.webdriver’].ChromeOptions() sys, selenium.webdriver
${disabled} Create List Chrome PDF Viewer
${prefs} Create Dictionary download.default_directory=${OUTPUT_DIR} safebrowsing.enabled=True plugins.plugins_disabled=${disabled} download.prompt_for_download=False
Call Method ${chromeOptions} add_experimental_option prefs ${prefs}
IF ‘${Browser}’==‘headlesschrome’
Call Method ${chromeOptions} add_argument --headless
SeleniumLibrary.Open Browser ${URL} ${BROWSER} executable_path=${webdriver_path} options=${chromeOptions}
Set Browser Implicit Wait 30s
Maximize Browser Window
Test Case
Click download.pdf //downloads a file after clicking
In headed mode, after clicking download.pdf, you need to do the typical file saving process wherein you need to enter the filename and click save.
Note: The code was completely working before we did an update on several packages/modules in requirements.txt above