WDA 实用语法



当节点含子节点时,实用path ,确定节点。

DATA lo_nd_barcd TYPE REF TO if_wd_context_node.

lo_nd_barcd wd_context->path_get_nodepath `MULTI_BARCD.BARCD` ).


跳出框

  DATA lo_window_manager TYPE REF TO if_wd_window_manager.
  DATA lo_api_component  TYPE REF TO if_wd_component.
  DATA lo_window         TYPE REF TO if_wd_window.

    lo_api_component  wd_comp_controller->wd_get_api).
    lo_window_manager lo_api_component->get_window_manager).
    lo_window         lo_window_manager->create_window(
                        window_name            'Z_MULTI_BARCD_WINDOW'
*                       title                  =
*                       close_in_any_case      = abap_true
                        message_display_mode   if_wd_window=>co_msg_display_mode_selected
*                       close_button           = abap_true
                        message_type           if_wd_window=>co_msg_type_none
                        ).

    lo_window->open).
    lo_window->set_window_sizewidth '600' height '300' ).


中文URL字符转化:

lo_unencoded  :A71048R系列标配中文.rar

lo_encoded:A71048R%e7%b3%bb%e5%88%97%e6%a0%87%e9%85%8d%e4%b8%ad%e6%96%87.rar

        CALL METHOD cl_http_utility=>if_http_utility~ESCAPE_URL
          EXPORTING
            unescaped lo_unencoded
          RECEIVING
            escaped   lo_encoded.


屏幕自定义MESSAGE_AREA .

需要在属性中添加变量 L_MESSAGE_MANAGER (IF_WD_MESSAGE_MANAGER)

  DATA l_controller TYPE REF TO if_wd_controller.
  l_controller wd_this->wd_get_api).
  CALL METHOD l_controller->get_message_manager
    RECEIVING
      message_manager wd_this->l_message_manager.


  DATA lv_text_003 TYPE string.
  lv_text_003 =
    wd_assist->if_wd_component_assistance~get_text'003' ).




  wd_this->l_message_manager->report_error_messagemessage_text lv_text_003 ).

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
WDA是一个用于iOS端自动化测试的Python库,而allure是一个用于生成漂亮报告的工具。要将WDA测试结果集成到allure报告中,可以使用pytest和allure-pytest插件来实现。 首先需要安装pytest和allure-pytest插件,可以使用以下命令进行安装: ``` pip install pytest pip install allure-pytest ``` 安装完成后,在pytest的测试用例中,可以使用pytest的fixture和allure的装饰器来将WDA测试结果保存到allure报告中。下面是一个示例: ```python import wda import allure import pytest @pytest.fixture(scope='module') def client(): c = wda.Client() return c @allure.feature('WDA测试') class TestWDA(object): @allure.story('测试页面标题') def test_title(self, client): title = client.title() assert title == 'Example Page' allure.attach(client.screenshot(format='png'), name='screenshot', attachment_type=allure.attachment_type.PNG) @allure.story('测试按钮点击') def test_button(self, client): btn = client(name='example_button') btn.tap() assert btn.exists allure.attach(client.screenshot(format='png'), name='screenshot', attachment_type=allure.attachment_type.PNG) ``` 在上面的示例中,使用了一个名为`client`的fixture来获取WDA的客户端连接,然后使用`allure.feature`和`allure.story`装饰器来定义测试用例的特性和故事。在每个测试用例中,使用了`allure.attach`方法将截图保存到allure报告中。 最后,可以使用以下命令来运行测试,并生成allure报告: ``` pytest --alluredir ./allure-results allure serve ./allure-results ``` 这样就可以将WDA测试结果集成到allure报告中,并且在报告中查看测试结果和截图。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值