0

I'm trying to connect to a qt application using webdriver-io and It is not able to access the port and does not communicate with the qt part of the application. I could get it to work with Java using the below setup.

// Setup QtWebDriver         
DesiredCapabilities capabilityQt = DesiredCapabilities.chrome();     
capabilityQt.setCapability("browserStartWindow", "*");          
// Run QtWebDriver        
WebDriver driverQt = new RemoteWebDriver(new URL("http://localhost:9517"), capabilityQt); 

Can someone provide me a javascript equivalent I tried this using selenium-webdriver js but I couldn't get it to work.

qtDriver: {             
desiredCapabilities: {                 
browserName: 'chrome',                 
browserStartWindow: '*'},             
port: 9517,             
host: 'localhost'} 

but it doesn't help.

Dominik Kunicki
  • 1,037
  • 1
  • 12
  • 35
N1992
  • 1
  • 1

3 Answers3

0

Try the following code:

var webdriverio = require('webdriverio');

var options = {
    desiredCapabilities: {
    browserName: 'chrome',                 
    browserStartWindow: '*',             
    port: 9517,             
    host: 'localhost'
    }
};

webdriverio.remote(options).init().end();
scopchanov
  • 7,966
  • 10
  • 40
  • 68
sayhan
  • 1,168
  • 1
  • 16
  • 22
0

I tried the above option as well. The only way I could make it work was with selenium-webdriver js driver.

var chromeCaps = webdriver.Capabilities.chrome();
chromeCaps.set('browserStartWindow','*');

const qtDriver = new webdriver.Builder()
      .usingServer('http://localhost:9517')
      .withCapabilities(chromeCaps)
      .build();
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
N1992
  • 1
  • 1
0
var webdriverio = require('webdriverio');

var options = {
    desiredCapabilities: {
    browserName: 'chrome',                 
    browserStartWindow: '*',             
    port: 9517,             
    host: 'localhost',
    path: '/'
    }
};

You need to specify the path or else it will pick up the default value /wd/hub. In this case which is not necessary.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
N1992
  • 1
  • 1