本文介绍了如何验证量角器中的网格表值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在量角器中,我想验证增加的值是否显示在网格中。
如何验证它?



网格如下所示:

解决方案

试试看在你的最后,让我知道它的工作原理:

  var a = element(by.xpath(// div [contains (msg).toEqual(test_protractor)$($) b $ b $)





  var a = element.all(by.xpath(// div [contains(text(),'test_protractor')]))。get(1).getText()。then(function(msg){
console.log(msg)
expect(msg ).toEqual(test_protractor)
})


In protractor, I want to verify whether added value is displaying in the grid.How do I validate it?

The grid looks like this:

解决方案

Try it at your end and let me know it works:

var a  = element(by.xpath("//div[contains(text(), 'test_protractor')]")).getText().then(function(msg){
  console.log(msg)
  expect(msg).toEqual("test_protractor")
})
var a  = element.all(by.xpath("//div[contains(text(), 'test_protractor')]")).get(1).getText().then(function(msg){
  console.log(msg)
  expect(msg).toEqual("test_protractor")
})

这篇关于如何验证量角器中的网格表值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 12:04