douxidang9092 2018-11-03 11:51
浏览 44

使用Selenium时嘲笑事物是否有意义?

I've done a bit of digging around and I was unable to find any solution that allows you to do the following;

  1. Mock some services in your PHP app
  2. Boot up a selenium instance
  3. Instruct it to make a request to your PHP app (/w mocked services)

Obviously this doesn't work because whichever testing framework you're using to mock services runs it's own PHP process, and a separate one is started once Selenium makes an HTTP request, and each process has it's own container instance.

Is the reason I haven't found anything that is able to do this simply that you shouldn't ever want to do this? I can imagine that with proper separation of things this functionality would never be needed, as UI/javascript behaviour should really be decoupled from server side business logic.

I figured that a valid use case would be the following;

You need to have some data stored in the session, e.g. recently viewed products for an ecommerce app, but you don't want to instruct selenium to actually view a bunch of products first since this is already covered in a different test, and the assertions that you want to make rely on javascript being executed.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图
    • ¥15 关于大棚监测的pcb板设计
    • ¥15 stm32开发clion时遇到的编译问题
    • ¥15 lna设计 源简并电感型共源放大器
    • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
    • ¥15 Vue3地图和异步函数使用