收藏
回答

miniprogram-automator自动化测试工具怎么自动输入文字到input框?

 miniprogram-automator自动化测试工具怎么自动输入文字到input框?
目前能获取到input的值但是设置不了,我是用taro框架写的小程序,照道理来说能获取到应该就能设置才对的。

const automator = require('miniprogram-automator');
 
automator.connect({
  wsEndpoint: 'ws://localhost:9420',
}).then(async miniProgram => {
  // 从首页重启
  const page = await miniProgram.reLaunch('/pages/index/index')
  const joinBtn = await page.$$('.index__card')
  await joinBtn[0].tap()//加入会议页面
  let enterPage = await miniProgram.reLaunch('/pages/joinConference/index')
  const inputInput = await enterPage.$$('input')
  await inputInput[0].tap()
 
  console.log(await inputInput[0])
  console.log(await inputInput[1].value())
   
  // await element[1].tap()//个人中心
}).catch(e => {
  console.log('catch a error', e);
});
回答关注问题邀请回答
收藏

1 个回答

  • 喵喵侠
    喵喵侠
    2019-10-09

    这个问题是在什么环境下出现的呢?

    如果你按照常规操作就可以获取到的话,那么就很可能是测试框架的问题

    2019-10-09
    有用
    回复 4
    • ~~~
      ~~~
      2019-10-31
      问题解决了
      2019-10-31
      1
      回复
    • 测试一下
      测试一下
      2019-11-04回复~~~
      你好,请问该怎么设置?
      2019-11-04
      回复
    • ~~~
      ~~~
      2019-11-05回复测试一下
      https://blog.csdn.net/qq_40816649/article/details/102463350这是我写的一篇博客可以看一下
      2019-11-05
      回复
    • 2019-11-15回复~~~
      我这边一直没有成功,代码 是这样的开发者工具是用的最新的
      2019-11-15
      回复
登录 后发表内容
问题标签