Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
229 views
in Technique[技术] by (71.8m points)

python - Robot framework setup is not working in pycharn

I'm new to python and I'm trying to learn the python robot framework, I have updated all the required plugin's, packages but when I'm executing the testcase it is throwing error module Object not found. I have tried all the suggestions in the online but still facing the same error. can some one please help me in this.

Packages Installed 1.robotframework 2.robotframework-seleniumlibrary 3.selenium

Plugin in Pycharm 1.intellibot (Latest version) 2.robot framework Support

robot file

*** Settings ***
Library    SeleniumLibrary

*** Test Cases ***
LoginTest
    create webdriver    chrome    executable_path="C:UsersDELLDownloadschromedriver_win32_newchromedriver.exe"
    go to    https://google.com

*** Keywords ***

Console

C:UsersDELLPycharmProjectsRobotF2>robot Test2.robot
==============================================================================
Test2
==============================================================================
LoginTest                                                             | FAIL |
TypeError: 'module' object is not callable
------------------------------------------------------------------------------
Test2                                                                 | FAIL |
1 critical test, 0 passed, 1 failed
1 test total, 0 passed, 1 failed
==============================================================================
Output:  C:UsersDELLPycharmProjectsRobotF2output.xml
Log:     C:UsersDELLPycharmProjectsRobotF2log.html
Report:  C:UsersDELLPycharmProjectsRobotF2
eport.html

And one more thing is, I have python installed in appdata/roaming/python/python 39 path and in Program Files folder.. In Pycharm, I have interpreter have choosen the python of Program Files..but env variable target to roaming/python folder and all the ibstalled packages are loaded inside of roaming/Python /python39/Lib/site-package folder, so does I need to set the interpreter path in pycharm to roaming python folder??

question from:https://stackoverflow.com/questions/65850139/robot-framework-setup-is-not-working-in-pycharn

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Try the following:

  1. When using chrome, download the latest chrome driver and also update the chrome browser to the latest version. The old chrome browser will not be triggered if you are using the latest version of the chrome driver.

  2. Put your python folder and chrome driver in the path of environment variables. Or you can just copy the chrome driver file inside the python folder and it will automatically be in path.

  3. Use the following code and run

    *** Settings ***
        Library    SeleniumLibrary     
    
    *** Test Cases ***
    
         LoginTest
            Open Browser    https://google.com    chrome
    

The chrome browser should open successfully running google.com


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...