It seems the second page is opening in a new tab, please switch the tab before interacting with the page:
ArrayList<String> tabs = new ArrayList<String>(driver....
Refer to this question:
chrome.window.onRemoved.addListener(), works only when a chrome process is running. The `driver.quit()` closes all the chrome processes.
Could you try this :
// Initializing instance of Firefox WebDriver
driver = new ChromeDriver();
wait = new ...
For of all thank everyone for your help!
The answer was quite simple and I hope some of the senior members dont get mad.
In order to access the elements on the second page all I that needed to be done is switch to the correct tab.
ArrayList<String> tabs2 = new ArrayList<String>(driver.getWindowHandles());
It turns out the reason chromedriver knows where chrome is installed is it looks for it in the default installation locations. See chromedriver requirements
I ended up using writing this script.
osname = platform.system()
if osname == 'Darwin':
installpath = "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ ...
You can obtain the browser version via WebDriver like this:
Capabilities cap = ((ChromeDriver) driver).getCapabilities();
I have tested it on Windows using old WebDriver version (2.44) vs current Chrome (78), I am not sure how this will work with new WebDriver vs old chrome on Ubuntu.
"Before a new major version of Chrome goes to Beta, a matching version of ChromeDriver will be released."
It means you can ask for the specific beta target version (currently 75) from your dependency management system and indicate the location of your Chrome Beta.