Skip to content

Commit

Permalink
Merge pull request #258 from vania-pooh/master
Browse files Browse the repository at this point in the history
Warning about wrong capability type
  • Loading branch information
aandryashin authored Dec 15, 2018
2 parents e457319 + b69f11f commit 1489582
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/log-files.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ The following statuses are available:
|===
| Status | Description

| BAD_CAPABILITY | User is passing non-string value for capability that should be string
| BAD_JSON | User request does not contain valid Selenium data
| BAD_RESPONSE | Upstream server returned data using unknown JSON protocol
| BROWSER_NOT_SET | Browser name is not present or empty string
Expand Down
5 changes: 3 additions & 2 deletions docs/quota-files.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ Here we define a list of browser names, their versions and default version for e
+
NOTE: A frequent question being asked is the meaning of `count` attribute because the name for historical questions is a bit confusing. You can have hosts with different number of CPU and memory allowing to run different number of browsers simultaneously. So `count` is the relative host weight allowing to adjust the load to every host depending on its capacity. For example if your quota contains two hosts with `count = 1` and `count = 3` then new session requests will be distributed as `1:3` between these hosts. The easiest way to deliver uniform load distribution is to set `count` equal to total number of browsers available on the host. This is what we always recommend to do by default.

. Browser name is matched against `browserName` capability. Values are compared as strings and should be exactly equal. When testing mobile applications (e.g. with http://github.com/appium/appium[Appium]) `browserName` capability makes no sense and can be replaced by `deviceName` capability. Ggr will try to match both against browser name specified in XML.
. Version `number` is matched against `version` or `browserVersion` capability by prefix. For example both `61` and `61.0` in version capability (i.e. in your code) will match version number `61.0`.
. Similarly version `platform` attribute is matched against `platform` or `platformName` capability by prefix. When platform from capabilities equals to `ANY` - default platform will be chosen.
. Sometimes you may need to have the same browser name and version on different platforms, e.g. Firefox on both Linux and Windows. To achieve this you need to add `defaultPlatform` and `platform` attributes to quota file as follows:
+
[source,xml]
Expand All @@ -48,8 +51,6 @@ NOTE: A frequent question being asked is the meaning of `count` attribute becaus
...
</qa:browsers>
----
. Version `number` is matched against `version` or `browserVersion` capability by prefix. For example both `61` and `61.0` in version capability (i.e. in your code) will match version number `61.0`.
. Similarly version `platform` attribute is matched against `platform` or `platformName` capability by prefix.

=== Proxying VNC Traffic

Expand Down
3 changes: 3 additions & 0 deletions proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"net/http"
"net/http/httputil"
"net/url"
"reflect"
"strings"
"sync"
"sync/atomic"
Expand Down Expand Up @@ -122,6 +123,8 @@ func (c caps) capabilityJsonWireW3C(jsonWire, W3C string) string {
pairs = append(pairs, fmt.Sprintf("%s=%v", k, v))
}
result = strings.Join(pairs, " ")
} else {
log.Printf("[-] [-] [BAD_CAPABILITY] [Using default value for capability %s: should be a string or a map but is %T] [-] [-] [-] [-] [-] [-]", k, reflect.TypeOf(m[k]))
}
})
return result
Expand Down

0 comments on commit 1489582

Please sign in to comment.