5

Sto usando il pacchetto npm webdriver-manager per avviare il driver sulla macchina. Fallisce se il driver è già avviato.Come si interrompe webdriver-manager?

C'è un modo per interrompere e riavviare il webdriver? O qualcosa come ignorare se già avviato?

+0

Si può spiegare la tua domanda un po 'di più? Come vuoi riavviare il webdriver? È manuale o tramite il codice? –

+0

Attraverso il codice node.js –

+8

Webdriver-manager non può essere arrestato. Tutto hail webdriver-manager. –

risposta

4

Se si utilizza il goniometro, è possibile aggiungere seleniumServerJar al file di configurazione e il goniometro avvia/arresta il server di selenio.

exports.config = { 
seleniumServerJar: "path/to/selenium-server-standalone-2.45.0.jar", 
... 
+0

Non ho avuto successo aggiungendo questo comando. Ho avuto un errore in seguito. C: \ Users \ xyx \ AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules \ selenium-webdriver \ http \ index.js: 145 callback (nuovo errore (messaggio)); ^ Errore: ECONNREFUSED collega ECONNREFUSED 127.0.0.1:4444 a ClientRequest. (C: \ Users \ xyx \ AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules \ selenium-webdriver \ http \ index.js: 145: 16) su emitOne (events.js: 77: 13) su ClientRequest .emit (events.js: 169: 7) su Socket.socketErrorListener (_http_client.js: 259: 9) su emitOne (events.js: 77: 13) – Nick

+0

Questo funziona per me. Grazie! – Gerfried

2

trovato questo nella another post

# stop selenium 
curl -s -L http://localhost:4444/selenium-server/driver?cmd=shutDownSeleniumServer > /dev/null 2>&1 
1

In bash si può chiudere in questo modo

kill $(ps -ef | grep webdriver | grep -v grep | awk '{ print $2 }') 
Problemi correlati