Page tree
Skip to end of metadata
Go to start of metadata

Supported in iOS Supported in Android

Supports: Google Chrome (Android) \ iOS Safari

The following commands allow users to change the current Javascript execution context of a mobile web browser, the tab with the current JS execution context is referred to as focused \ active tab

Switching tabs will not display on the browser the tab with the ID that you wanted to switch to, but will only change the JS Execution context

getCurrentBrowserTab - returns the internal browser ID of the active (focused)

getBroswerTabIdList - returns a List of all opened tab id's

switchToBrowserTab - Switches JS execution context to the ID provided


Examples - working with browser tabs
		String currentId = client.getCurrentBrowserTabId(); 
		List<String> tabs = Arrays.asList(client.getBrowserTabIdList());
		for (String tabId : tabs)
		{
			client.switchToBrowserTab(tabId);
			System.out.println(client.hybridRunJavascript("", 0, "result = document.URL")); // will print out all open tabs
		}
		client.switchToBrowserTab(currentId); // returns JS context to the original tab - which is displayed in the browser






  • No labels