Automate two environments using JAVA