Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add func 'NewIEDriverService' for simply support call IEDriverService #242

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To properly support this, this needs tests, which is not a small undertaking:

  1. A new top-level test function needs to be added to selenium_test.go, called TestInternetExplorer, similar to the other tests in that file.
  2. Somehow, we'll need to skip that test if it isn't executed on Windows.
  3. We should add a run on Travis in Windows environment.

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,
Expand Down