I know one method is with "https://dzone.com/articles/automate-zap-security-tests-with-selenium-webdrive-1"
But are there direct commands that can scan our selenium application execution by OWASP ZAP?.
I think it should be possible then a full project. Very few sites are available openly or without login.
You can user docker.
Install or pull docker image -
" docker pull owasp/zap2docker-stable "
You can start the ZAP in headless mode with following command -
" docker run -u zap -p 8080:8080 -i owasp/zap2docker-stable zap.sh -daemon -host 0.0.0.0 -port 8080 -config api.addrs.addr.name=.* -config api.addrs.addr.regex=true -config api.disablekey=true "
Run your Selenium tests independently but within selenium tests configure the proxy to hit port 8080 (or whichever you are using).
The following command will generate report in the container -
" docker exec $container_Id zap-cli report -o vulnerability.html -f HTML "
you can copy this report anywhere. Then stop the container and remove it.