FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
browserstack-local-java/BrowserStackLocalExample.java at LOC-6727 · browserstack/browserstack-local-java · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
browserstack
/
browserstack-local-java
Public
Notifications
You must be signed in to change notification settings
Fork
33
Star
21
Code
Issues
19
Pull requests
9
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
browserstack-local-java
/
BrowserStackLocalExample.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
46 lines (37 loc) · 1.51 KB
Breadcrumbs
browserstack-local-java
/
BrowserStackLocalExample.java
Copy path
File metadata and controls
46 lines (37 loc) · 1.51 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package
com
.
browserstack
;
import
java
.
net
.
URL
;
import
java
.
util
.
HashMap
;
import
org
.
openqa
.
selenium
.
WebDriver
;
import
org
.
openqa
.
selenium
.
remote
.
DesiredCapabilities
;
import
org
.
openqa
.
selenium
.
remote
.
RemoteWebDriver
;
public
class
BrowserStackLocalExample
{
private
WebDriver
driver
;
Local
l
;
public
static
void
main
()
throws
Exception
{
String
username
=
System
.
getenv
(
"BROWSERSTACK_USERNAME"
);
String
access_key
=
System
.
getenv
(
"BROWSERSTACK_ACCESS_KEY"
);
DesiredCapabilities
caps
=
new
DesiredCapabilities
();
caps
.
setCapability
(
"browser"
,
"Firefox"
);
caps
.
setCapability
(
"browser_version"
,
"40.0"
);
caps
.
setCapability
(
"os"
,
"Windows"
);
caps
.
setCapability
(
"os_version"
,
"8.1"
);
caps
.
setCapability
(
"browserstack.local"
,
true
);
l
=
new
Local
();
HashMap
<
String
,
String
>
options
=
new
HashMap
<
String
,
String
>();
options
.
put
(
"key"
,
access_key
);
//options.put("only", "localhost,80,0");
//options.put("forcelocal", "");
//options.put("proxyHost", "127.0.0.1");
//options.put("proxyPort", "8118");
//options.put("xyz", "qwerty");
l
.
start
(
options
);
System
.
out
.
println
(
"Starting session"
);
driver
=
new
RemoteWebDriver
(
new
URL
(
"http://"
+
username
+
":"
+
access_key
+
"@hub.browserstack.com/wd/hub"
),
caps
);
System
.
out
.
println
(
"Started session"
);
driver
.
get
(
"http://localhost"
);
System
.
out
.
println
(
"Process is running : "
+
l
.
isRunning
());
System
.
out
.
println
(
"Page title is: "
+
driver
.
getTitle
());
driver
.
quit
();
l
.
stop
();
}
}
Back
|
FazBrowse Home
|
New Git URL