robotframework python

真心不容易
折腾了一天
![在这里插入图片描述](https://img-blog.csdnimg.cn/f52696c953fd49ecba9ddb1b2312cd07.png
在这里插入图片描述在这里插入图片描述

from .MyKeywords import MyKeywords

class MyLibrary(MyKeywords):
	
    ROBOT_LIBRARY_SCOPE = 'GLOBAL'
# encoding:utf8

import time
class MyKeywords():
	
    def __init__(self):
        pass

 
    def get_current_time(self):
        current_time = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))
        return current_time

在这里插入图片描述
在这里插入图片描述在这里插入图片描述

在这里插入图片描述

先就这样,起码没变成红色了
感谢TST的老师!

今日目标:把rf+APPNIUM需要的文件在电脑上配置好

### RobotFramework with Python 3.9 Installation Configuration and Usage #### Installing Required Software Dependencies Before installing Robot Framework, ensure that Python is installed on the system. For a specific version such as Python 3.9, one can use `pyenv` to manage multiple versions of Python easily[^3]. Once Python 3.9 has been set up using pyenv or another method, proceed with setting up pip which comes bundled with Python. #### Setting Up Environment for Development To create an isolated environment specifically tailored for working with Robot Framework under Python 3.9, virtual environments are recommended. This ensures dependencies do not interfere with other projects. ```bash python3.9 -m venv my_robot_env source my_robot_env/bin/activate ``` #### Installing Robot Framework via Pip With the correct Python version active within a virtual environment, install Robot Framework along with its SeleniumLibrary dependency through pip: ```bash pip install robotframework seleniumlibrary ``` This command installs both packages into the current environment ensuring compatibility with Python 3.9[^1]. #### Configuring Test Execution Options For configuring test execution options when running tests written in Robot Framework syntax, refer to the documentation provided by Robot Framework itself rather than generic configure scripts used during compilation processes like those mentioned for Linux installations[^2]. The framework supports various command-line arguments allowing customization without needing manual configuration files editing. #### Running Tests Using Installed Version After completing all previous steps successfully, executing tests becomes straightforward utilizing commands similar to below example where `-d output_directory` specifies results storage location while `testsuite.robot` represents your actual test suite file path: ```bash robot -d output_directory testsuite.robot ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值