duanpo1498 2014-11-16 00:08
浏览 30

如何在场景测试中从一个站点捕获数据以填充另一个站点上的字段

I am new to Behat scenario testing and wanted to know how to or best practice to capture/store data from one site to use on another site to fill in user information. For example site 1 can create a user profile such as user ID and password. Site 2 take user ID and password from site 1 and use it on site 2 to fill in the requested ID and password logging the user into the site.

I can do this with java and selenium web driver and with a string name from site 1 and call that string in site 2 at the user id location with “send keys (string)”. What is the best way to do this with behat PHP scenario and feature context setup?

I have also reviewed on this site "How to test with behat two sites in the same test, which helps with the first stage of the scenario, but not the filling in data on site two.

  • 写回答

1条回答 默认 最新

  • dongyong3590 2014-11-18 08:26
    关注

    First please tell version of behat. It is big diffrence between v2.5 and v3.0. Do you use Mink? In that case you have CSSSelector to extract values. Next you need to save them. You could do this in context saving as value in given step, but for everytime you will repeat this for others data.

    To feel data of form in other you simply write create form in context, but still you repeat this for each form.

    I created some universal lib for holding data and sending this to scenarion. Still in dev, but could help: clipboard

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题