1

I am new to robot framework python, I am using eclipse RED editor.

*** Settings *** Documentation Simple example using SeleniumLibrary. Library SeleniumLibrary *** Test Cases *** MyFirstTest Log Hello World... FirstSeleniumTest Create Webdriver chrome executable_path=/Users/ljames/Downloads/chromedriver Open Browser https:google.com chrome Close browser 

I am seeing following error msg:

TypeError: 'module' object is not callable

I am using mac. how to fix it? "Chomedriver" file exist in the Downloads path mentioned above.

2

2 Answers 2

1

Try changing the driver_name from chrome to Chrome. (Only with Open Browser Keyword, the browser_names are case-insensitive). Make note- Create webdriver keyword is mostly followed by Go to, since you have already created your driver instance.

3
  • Thanks. Create webdriver Chrome executable_path=/Users/ljames/Downloads/chromedriver Open Browser google.com Chrome Close Browser Chrome browser opens now but it doesn't close. I get following error msg. WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see sites.google.com/a/chromium.org/chromedriver/home path specified is correct. Not sure what's missing. please help.
    – autostack
    CommentedJun 22, 2020 at 11:59
  • The keyword 'Open Browser' triggers an error if you dont have the chromerdriver executable in PATH. Setting Custom executable path can be done only with 'Create Webdriver' Keyword. So if you want to use 'Open Browser' Keyword, add the chromedriver location into your PATH environment variable.CommentedJun 22, 2020 at 14:37
  • '*** Settings *** Library SeleniumLibrary *** Test Cases *** FirstSeleniumTest-1 Create Webdriver Chrome executable_path=/Users/ljames/Downloads/chromedriver Go To https:google.com Close browser FirstSeleniumTest-2 Open browser https:google.com chrome Close browser'CommentedJun 22, 2020 at 14:42
0

In addition to what aravinth_2442 has said, you also have a wrong URL as an argument to Open Browser keyword. It might be just a typo here in your question, but you should correct it as well to:

Open Browser https://www.google.com Chrome 

You can see the official documentation here: https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Open%20Browser So make sure, you type correctly the names of browsers, they are case-sensitive.

4
  • Thanks. Create webdriver Chrome executable_path=/Users/ljames/Downloads/chromedriver Open Browser google.com Chrome Close Browser Chrome browser opens now but it doesn't close. I get following error msg. WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see sites.google.com/a/chromium.org/chromedriver/home path specified is correct. Not sure what's missing. please help.
    – autostack
    CommentedJun 22, 2020 at 11:59
  • You either need to specify executable_path with the keyword, which in your example seems to be defined incorrectly. By the names, it seems you're on Windows, but path /Users/ljames/Downloads/chromedriver is incorrect, there's for instance no drive letter specified. Fix this. Or you can change the value of PATH variable and leave out executable_path from the list of arguments.CommentedJun 22, 2020 at 12:07
  • Thanks. Thanks. I am on mac, not windows. could advise what do you mean by executable_path with the keyword? FirstSeleniumTest Create webdriver chrome executable_path=/users/ljames/Downloads/chromedriver Open Browser google.com chrome Close Browser chrome doesn't open with www.google.com, it opens with "data:,". What am I missing here? @aravinth_2442
    – autostack
    CommentedJun 22, 2020 at 12:51
  • Ok, you got the path working. "could advise what do you mean by executable_path with the keyword?" Just read what you're posting, it's right there in your example. And in the documentation that you should be reading. You can find it here: robotframework.org/SeleniumLibrary/SeleniumLibrary.html search for your keywords and follow the text, you should be able to fix it faster than waiting here for answers.CommentedJun 22, 2020 at 12:57

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.