Hi,
I’m trying to create a robot that will create a folder and download some pictures to put it in that folder.
Folder was created with correct name, but the pictures was just put in my ‘main’ folder with names like 1.jpg, 2.jpg. Not in the new folder.
I’m sure its something to do with my RETURN, but don’t know how to fix it.
*** Settings ***
Documentation Template robot main suite.
Library RPA.Browser.Selenium auto_close=${False}
Library RPA.HTTP
Library RPA.Desktop
Library RPA.FileSystem
*** Variables ***
${DOWNLOAD_PATH}= ${OUTPUT DIR}${/}
${MAIN_URL}= https://www.mywebpage.com/
${src}= ${EMPTY}
${name}= ${EMPTY}
*** Tasks ***
Download pictures from web
Open webside
Click on next
*** Keywords ***
Open webside
Open Available Browser ${MAIN_URL}
Create gallery folder
${name}= Get Text alias:Gallery name
Create Directory ${DOWNLOAD_PATH}${name}
Log ${name}
RETURN ${name}
Click on next
Create gallery folder
${x}= Set Variable ${0}
WHILE ${x} < 2
Wait Until Page Contains Element //[@id=“slideshow”]/center/div[1]/span/img timeout=30
${src}= Get Element Attribute //[@id=“slideshow”]/center/div[1]/span/img src
Click Element alias:Nextnthchild2img
${x}= Evaluate ${x} + 1
Download ${src} ${DOWNLOAD_PATH}${name}/\ ${x}.jpg
Log ${name}
END