PDA

View Full Version : How to start selenium-server on a separate machine and run CLI on orther machine.?



TinhDuong
7 Aug 2016, 12:54 AM
Hi All,

I can run Sencha Test by CLI in local successfully with using selenium-server as a "browser pool".

Here is my code:

workspace.json

Code:


{
"frameworks": {
"ext": "ext"
},
"build": {
"dir": "${workspace.dir}/build"
},
"packages": {
"dir": "${workspace.dir}/packages/local,${workspace.dir}/packages",
"extract": "${workspace.dir}/packages/remote"
},
"name": "Project",
"tests": {
"browser": {
"farms": [
{
"name": "WebDriver",
"type": "generic",
"host": "127.0.0.1",
"port": 4444,
"sessionLimit": 1,
"pools": [
{
"name": "pool",
"path": "test/pool.json"
}
]
}
]
}
}
}




pool.json



[
{
"chunks": 1,
"browserName": "chrome",
"platform": null,
"version": 52
}
]


project.json



{
"framework": "jasmine",
"libs": [],
"coverageFilters": [],
"scenarios": [
{
"libs": [],
"coverageFilters": [],
"directory": "unit",
"name": "Unit Tests"
}
]
}


And I run:




java -jar selenium-server-standalone-2.53.0.jar -Dwebdriver.chrome.driver="path
to\chromedriver.exe"

to start selenium-server



sencha run -o text -p pool -s test/unit

to run Sencha Test by CLI

And selenium-server and CLI running on the same machine local.

But I want to install and start selenium-server on the machine A and run CLI on machine B to connect into Browser Farm machine.
I've tried changed config :


"host": "127.0.0.1","port": 4444,

in workspace.json into IP of machine A



"host": "192.68.1.39","port": 4444,

then start selenium-server in machine A
after that run Sencha Test by CLI in machine B but not success.

Error when I run:

Machine B:

stc run -o text -p pool -s test/unit
Sencha Test v1.0.1
[AGENT: 1] Launching agent
[AGENT: 1] Agent failed (will retry): Agent didn't register within 25000 ms (sessionID: undefined)

Machine A: The web browser is started on the machine A, but it cannot connect to my app, the address it used is "http://localhost:8000/index.php/login?orionAgentId=1".

Anyone can help me?
or other way to do what I want?

warrenpostma
29 Sep 2016, 12:42 PM
It sounds like what you actually want is a browser farm. Then you should be able to use the Sencha Studio to connect to a remote browser farm.

marcelofarias
29 Sep 2016, 3:02 PM
Use the callback address switch in the command line.

From stc run -h:


-c, --callbackAddress Address trough which browsers can connect to the local
machine, if other than localhost [string]

Suppose the following setup:

Machine A
- 192.168.1.100
- this is where stc runs

Machine B
- 192.168.1.101
- this is where selenium server runs

Then on the stc run command line you should do something like:


stc run -c 192.168.1.100 -s my/scenario/somewhere -p my-remote-pool-name

Regards