hyperlink - python function that checks link and if its a download only allows it if its less than 5mb -


i using robot framework. trying define keyword accepts argument of link xpath. when receives link click , if download link determine if file size greater argument 2

if file downloading , size greater limit passed cancel download. can click part have no clue how size , if download function , cannot cancel part windows function , i'm doing things selenium webdriver. solution must using python script interrogate file before actions download? since robotframework uses python codig base couldn't command modified include little tweak?

when receives link click , if download link...

once you've clicked on link, download initiate. it's late determine size (sort of).

use head request - requests.head(...) on link href (the url); not get method. 1 of headers should content-length in bytes. if so, can determine if want download file or not.

and you'll need use requests library , integrate keyword. or available robotframework-httplibrary.


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -