如何验证量角器中的网格表值? [英] How to validate the grid table value in protractor?
本文介绍了如何验证量角器中的网格表值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何验证它?
网格如下所示:
解决方案
试试看在你的最后,让我知道它的工作原理:
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")
})
If there are multiple and you want to get only first row then
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")
})
这篇关于如何验证量角器中的网格表值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文