Test Salesforce Service Cloud Toolkit API from Brower Console

Service Cloud Toolkit API cannot be used with our browser Console tab. So, you can create a Visualforce page to run it.

1. Create a VF page in your sandbox.

2. Enable "Available for Lightning Experience, Lightning Communities, and the mobile app".

3. Add the below code to the Visualforce page.

<apex:page >
    <apex:includeScript value="/support/console/43.0/integration.js"/>
        sforce.console.getEnclosingPrimaryTabId( function(result) {
            console.log( 'Inside' );
            sforce.console.openSubtab(result.id, '/apex/Example', true, 'test', null, null, 'test', function(openResult) {
                console.log('opening subtab');

4. Add the Visualforce page to a lightning record page.

When the record is opened, it will open the Example Visualforce page as sub-tab.