How can I add selenium grid in my app on streamlit cloud in order to run multiple browsers at the same time?
Take look at this quickstart (Getting started with Selenium Grid | Selenium)
I need to install java for that,
How can I install java in streamlit and then do
java -jar selenium-server-<version>.jar standalone ?
Unfortunately you will not be able to install and use Java on Streamlit Cloud. If you really need to use Java, you will have to look at hosting it somewhere else, potentially on your own server so that you can install whatever you want.
However, you might also look around on the forum to see how others are using selenium with streamlit, as you may find other ways to potentially address your use case.