예제 #1
0
func OpenWithClient(url string, capabilities map[string]interface{}, client *http.Client) (*Session, error) {
	busClient, err := bus.Connect(url, capabilities, client)
	if err != nil {
		return nil, err
	}
	return &Session{busClient}, nil
}
예제 #2
0
파일: webdriver.go 프로젝트: queran/agouti
func (w *WebDriver) Open(desiredCapabilites map[string]interface{}) (*Session, error) {
	url, err := w.service.URL()
	if err != nil {
		return nil, fmt.Errorf("cannot retrieve URL: %s", err)
	}

	busClient, err := bus.Connect(url, desiredCapabilites)
	if err != nil {
		return nil, fmt.Errorf("failed to connect: %s", err)
	}

	session := &Session{busClient}
	w.sessions = append(w.sessions, session)
	return session, nil
}