Protractor : Getting 'No Such Context Found' after launching a Hybrid app on mobile emulator

Viewed 1165

I am trying to run protractor tests by launching a Hybrid app on a mobile emulator. My app is getting launched but then it is getting closed with the error message: 'WebDriverError: No such context found'.
I tried implementing 'setWebContentsDebuggingEnabled : true' from GitHub but this also didn't work. I searched everywhere and asked everyone but no one has the solution to this. I am pretty new to Protractor so any info on this is really helpful.

Environment details:  
appium version : 1.6.5  
Android Studio : 2.3.3  
emulator : Nexus 5X API 24 (Android 7)

Error message when running the test without 'autoWebView:true': Unable to start a WebDriver session. Error message when running the test with 'autoWebView:true': WebDriverError: No such context found.

Here is my conf.js file :

exports.config = {

  seleniumAddress: 'http://localhost:4723/wd/hub',


  capabilities: {  
   browserName: '',  
   'appium-version': '1.6.5',  
    platformName: 'Android',  
    platformVersion: '7.0',    
    deviceName: 'Android Emulator',  
    autoWebview: 'true',    
    autoWebviewTimeout: '10000',  
    setWebContentsDebuggingEnabled:'true'  
    app: 'C://Users//ss//AppData//Local//Android//sdk//platform-tools//WM.apk',     

  },  

  baseUrl: 'http://10.0.2.2:8000',  

  specs: ['basic_spec.js'],  

  framework: 'jasmine2',  

  jasmineNodeOpts: {  
    defaultTimeoutInterval: 120000,  
  },  
};
0 Answers
Related