量角器-如何使用console.log打印参数本身

时间:2019-05-14 14:41:12

标签: protractor

我正在尝试在控制台上打印参数本身。我的示例代码如下:

it('should print the parameter value', async function(){
    expect (PO.printParameterandDoSomethingElse(myElement1)).toBe(true); 
}

Page对象是:

this.printParameterandDoSomethingElse = async function(ele){
   console.log(ele)
   //do something
   //do something else
   //return output
}

我希望打印“ MyElement1”,但是在此代码中,控制台正在打印“ [object Object]”,而不是参数本身(MyElement1)。我在github thread中找到了一个讨论,其中另一个用户遇到了同样的问题,但是我找不到她的SO线程。有没有办法做到这一点?

0 个答案:

没有答案