无法在JMeter中记录Power Bi嵌入Web应用程序.app.powerbi.com引发错误

问题描述

我正在使用Apache JMeter 5.3。当我的应用程序点使用代理连接到https://app.powerbi.com时,我遇到了问题。我尝试在代理后面使用,它没有帮助。

请帮助我解决错误消息

错误消息:

java.net.UnkNownHostException: app.powerbi.com
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(UnkNown Source)
at java.net.InetAddress.getAddressesFromNameService(UnkNown Source)
at java.net.InetAddress.getAllByName0(UnkNown Source)
at java.net.InetAddress.getAllByName(UnkNown Source)
at java.net.InetAddress.getAllByName(UnkNown Source)
at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
at org.apache.http.impl.conn.DefaultHttpClientConnectionoperator.connect(DefaultHttpClientConnectionoperator.java:112)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$JMeterDefaultHttpClientConnectionoperator.connect(HTTPHC4Impl.java:401)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:930)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:641)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:66)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1281)
at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:234)

解决方法

&,您正在尝试使用IPv6 implementation获取app.powerbi.com的IP地址。

根据https://en.wikipedia.org/wiki/IPv6,该网站不支持IPv6

enter image description here

您可能想通过将下一行添加到 system.properties 文件中来restrict Java TCP/IP stack to IPv4 only

 val df = Seq((25,10,"a&c","i&j&k"),(35,15,"a&b&d","i&k")
      .toDF("num1","num2","x","y")
  val dfProcessed = df.withColumn("x",split($"x","&"))
      .withColumn("y",split($"y","&"))
      .select("num1","y")

    val headers = Seq("a","b","c","d","i","j","k")
    val report = dfProcessed.select(Seq("num1","num2").map(col) ++ headers.map(line => array_contains('x,line)
      || array_contains('y,line) as line) : _*)

    report.show()

需要重新启动JMeter才能获取该属性。

或者,您可以考虑使用另一种记录方式:JMeter Chrome Extension,使用它时,您不必担心代理,证书,协议版本等。