From ebf1d3aefcb9e0af14631ae49cca7b9ec18a9271 Mon Sep 17 00:00:00 2001 From: huahua <769200142@qq.com> Date: Mon, 10 May 2021 10:35:10 +0800 Subject: [PATCH] add func 'NewIEDriverService' for simply support call IEDriverService --- service.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/service.go b/service.go index 784ccd8..3bd344d 100644 --- a/service.go +++ b/service.go @@ -221,6 +221,19 @@ func NewGeckoDriverService(path string, port int, opts ...ServiceOption) (*Servi return s, nil } +// NewIEDriverService starts a IEDriverServer instance in the background. +func NewIEDriverService(path string, port int, opts ...ServiceOption) (*Service, error) { + cmd := exec.Command(path, "--port="+strconv.Itoa(port)) + s, err := newService(cmd, "", port, opts...) + if err != nil { + return nil, err + } + if err := s.start(port); err != nil { + return nil, err + } + return s, nil +} + func newService(cmd *exec.Cmd, urlPrefix string, port int, opts ...ServiceOption) (*Service, error) { s := &Service{ port: port,