Setting global variables through python script.

38 views
Skip to first unread message

Naveen Rajamannar

unread,
Mar 15, 2023, 6:10:22 AM3/15/23
to OWASP ZAP User Group
Hi,

I am capturing an element/link from web element using python script as follows

email_content = driver.find_element("xpath", "//a[text()='']").get_attribute('href')

Now how do I use it in other scripts or set a global variable in python. I am using stand alone scripts.

Thanks,

thc...@gmail.com

unread,
Mar 15, 2023, 6:14:44 AM3/15/23
to zaprox...@googlegroups.com
Hi.

See:
https://www.zaproxy.org/docs/desktop/addons/script-console/#custom-globalscript-variables

While the example is for JavaScript the logic is the same for any
language, just import the classes using the Python syntax.

Best regards.
Reply all
Reply to author
Forward
0 new messages