codeforequity-at / botium-core

The Selenium for Chatbots - Bots Testing Bots
https://www.botium.ai
MIT License
229 stars 64 forks source link

selenium webdriver connection #282

Closed dShreya1701 closed 5 years ago

dShreya1701 commented 5 years ago

CONTAINERMODE : webdriverio WEBDRIVERIO_URL : my_link WEBDRIVERIO_PROFILE : botbuilder_webchat_v4 WEBDRIVERIO_START_SELENIUM : true WEBDRIVERIO_START_SELENIUM_OPTS : { "drivers": { "chrome": { "version": "74.0.3729.131" } } } WEBDRIVERIO_OPTIONS : {"desiredCapabilities": { "browserName": "chrome", "platformName": "Windows 10"
} }

I have set all these capability in botium box but when I am connecting it to the bot it is showing the error "Chatbot connection failed - not found: java". why is this error coming?

codeforequity-at commented 5 years ago

Obviously, there is no Java VM installed.

dShreya1701 commented 5 years ago

so my sysytem should have JAVA VM installed after that it will work right?

codeforequity-at commented 5 years ago

When you install a Java VM, then the "not found: java"-problem is solved. I cannot tell if there will be other problems then.

dShreya1701 commented 5 years ago

actually JAVA is installed in my system (only jre is there not JDK) but still it is showing the same error.

dShreya1701 commented 5 years ago

and it should only be installed in the system right or is there any capability we have too set to make it work?

codeforequity-at commented 5 years ago

Java has to be in the PATH as well - so when you are opening a command line window and writing "java", then Java should get executed - if not, then Botium won't work as well. JRE is ok, you don't need JDK. Did you follow the preparation steps from the instructions ? https://github.com/codeforequity-at/botium-connector-webdriverio

dShreya1701 commented 5 years ago

yes I have followed the same steps on given link. JAVA is set in the PATH - when I am typing java in cmd, it is getting executed. I don't know what is the problem.

dShreya1701 commented 5 years ago
  1. java is there and is set in the path.

  2. the following capabilities are set: CONTAINERMODE : webdriverio WEBDRIVERIO_URL : my_link WEBDRIVERIO_PROFILE : botbuilder_webchat_v4 WEBDRIVERIO_START_SELENIUM : true WEBDRIVERIO_START_SELENIUM_OPTS : { "drivers": { "chrome": { "version": "74.0.3729.131" } } } WEBDRIVERIO_OPTIONS : {"desiredCapabilities": { "browserName": "chrome", "platformName": "Windows 10" } }

  3. selenium is running in the command line port 4444.

Is there anything else which I have to set? port 4444 is to be set anywhere?

codeforequity-at commented 5 years ago

Try to run an own Selenium Server, and set the capabilitiy WEBDRIVERIO_START_SELENIUM to false.

dShreya1701 commented 5 years ago

i set WEBDRIVERIO_START_SELENIUM to false. I am getting "Chatbot connection failed - connect ECONNREFUSED 127.0.0.1:4444" error

codeforequity-at commented 5 years ago

Yes, because you have to run a Selenium server. Please try to make Selenium work on your workstation first before trying to run Botium.

dShreya1701 commented 5 years ago

and I tried with phentom also by setting capabilities: WEBDRIVERIO_START_PHANTOMJS : true WEBDRIVERIO_START_PHANTOMJS_ARGS : --webdriver=4444 phentom is running is command prompt. I am getting "Chatbot connection failed - spawn /app/server/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs ENOENT" error.

dShreya1701 commented 5 years ago

own selenium server meaning? i have run the following command to install selenium server

  1. git clone https://github.com/codeforequity-at/botium-connector-webdriverio.git
  2. npm install
  3. npm run selenium-install
  4. npm run selenium
codeforequity-at commented 5 years ago

ok, to be honest, I have no idea why there is no JVM available when you are trying to start the selenium server. There are a lot of possible reasons for it, and no one of them is specific to Botium. Maybe the guys at https://github.com/vvo/selenium-standalone have more experience with this kind of problems, this library is included by Botium for convenience.

oferdan commented 5 years ago

Hi, I have same problem. I tried to setup my own Webdriver.io through Botium Box > Chatbots > Register new chatbot. I've filled every field required and tried to run bot in Live chat but got error about WEBDRIVERIO_OPTIONS. So I edited botium.json from sample and used Import/Export tool on Chatbots page. Now when I try to run Live chat, all I get is "Chatbot connection failed - not found: java".

codeforequity-at commented 5 years ago

Botium Box is not meant to be used as Selenium server, that's why there is no JVM included in the current build. You should setup your own Selenium server, install your required browser drivers there, and then connect Botium Box to it (in Settings / Device Providers) - documentation on this is coming very soon.

Live Chat is currently not supported with Webdriver chatbots - but you found a workaround by manually adding the required capabilities currently missing from the Live Chat :-)

oferdan commented 5 years ago

I tried to run Live chat, because when I have Webdriver Bot in Test Project and I tried to run tests with Integrated PhantomJS I got error: "Job failed: Error: spawn /app/agent/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs ENOENT". Thanks for clarification.