Rasukarusan / shellnium

:dizzy: Selenium Webdriver for Bash (or Zsh).
https://shellnium-site.vercel.app
MIT License
173 stars 21 forks source link

Getting error while running the sh files #5

Closed junaidbinfarooq closed 3 years ago

junaidbinfarooq commented 3 years ago

Hi, Thanks for the work. Much appreciated. I am facing some issues while running the .sh files. I get the following errors

demo.sh: 2: source: not found
demo.sh: 6: navigate_to: not found
demo.sh: 9: find_element: not found
demo.sh: 12: send_keys: not found
demo.sh: 14: delete_session: not found

Is there anything missing on my computer or there is something else going wrong here?

Rasukarusan commented 3 years ago

Thank you for your interest!

This is probably because the source command is not being executed. Could you please try this?

demo.sh

#!/usr/bin/env bash
. ./lib/selenium.sh # <-- change `source` to `.`

main() {
....
junaidbinfarooq commented 3 years ago

@Rasukarusan Nope. Doesn't work. Same error with the following, which might be the cause, at the end: [ERROR] chromedriver is not running.

ko1nksm commented 3 years ago

Hello,

Try

chmod +x ./demo.sh # only once
./demo.sh

or

bash demo.sh

The following error means that your sh (/bin/sh) does not implement the source command.

demo.sh: 2: source: not found

From the README.md, @Rasukarusan seems to be using macOS. On macOS, sh is bash. @junaidbinfarooq, You're probably using Ubuntu or Debian, aren't you? On Ubuntu/Debian, sh is dash.

The source is an extended command of bash, and cannot be used with dash (a pure POSIX compliant shell).

Rasukarusan commented 3 years ago

@ko1nksm thanks your reply! I'm glad for your help:raised_hands:

junaidbinfarooq commented 3 years ago

@ko1nksm Thanks for the help. It helped partially. I was able to run the chrome but not as I expected. I got the following error this time: ./lib/core.sh: line 17: jq: command not found

Rasukarusan commented 3 years ago

@junaidbinfarooq install jq. https://github.com/stedolan/jq