YONGFEIUALL

izheyi.com


  • Home

  • Archives

  • Categories

  • Tags

  • About

  • Search

2017春节

Posted on 2017-01-30 | In 丁丁 |

今年由于种种原因,还是没能回的了老家过年,已经两年没有回家过年了,虽然说在家很无聊,回家呆不了三天就想着回来,但心里还是有想回家的冲动,不是纯粹为了过年,而是想回家。

本来说是去圆明园看庙会,竟然说不办了,买了票进去走了一圈就出来去了颐和园,圆明园大冬天的本来也就没啥好看的。颐和园也没活动,就看了腊梅展,因为经常来这里,跟平常没啥两样。



Read more »

SoupUI - Jenkins run has error: Invalid format for date field

Posted on 2016-12-16 | In SoapUI |

In soapui, we use date in the below format:

we can run correctly when we run this with SoupUI tool directly, but when we run with jenkinins + Maven, have invalid format error:

1
2
3
4
{
"status": 400,
"message": "Invalid format for from or to date field."
}

Seems the date doesn’t encoding when we run script with Jenkins, so we need to this manually when design script with SoapUI:

SoupUI - Jenkins run has error:org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath cannot be cast to org.apache.xmlbeans.impl.store.SaxonXBeansDelegate$SelectPathInterface

Posted on 2016-12-05 | In SoapUI |

Recently, i run SoapUI script with Jenkins + Maven, encounter the below error message:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
java.lang.RuntimeException: java.lang.ClassCastException: org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath cannot be cast to org.apache.xmlbeans.impl.store.SaxonXBeansDelegate$SelectPathInterface
at org.apache.xmlbeans.impl.store.SaxonXBeansDelegate.createInstance(SaxonXBeansDelegate.java:102)
at org.apache.xmlbeans.impl.store.Path$SaxonPathImpl.create(Path.java:448)
at org.apache.xmlbeans.impl.store.Path.getCompiledPathSaxon(Path.java:185)
at org.apache.xmlbeans.impl.store.Path.getCompiledPath(Path.java:115)
at org.apache.xmlbeans.impl.store.Path.getCompiledPath(Path.java:91)
at org.apache.xmlbeans.impl.store.Cursor._selectPath(Cursor.java:902)
at org.apache.xmlbeans.impl.store.Cursor.selectPath(Cursor.java:2634)
at org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.java:431)
at org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.java:415)
at com.eviware.soapui.support.xml.XmlUtils.getXPathValue(XmlUtils.java:1349)
at com.eviware.soapui.assertion.messagecontent.MessageContent.setCurrent(SourceFile:149)
at com.eviware.soapui.impl.wsdl.teststeps.assertions.MessageContentAssertion.internalAssertResponse(SourceFile:102)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlMessageAssertion.assertResponse(WsdlMessageAssertion.java:150)
08:09:30,321 DEBUG [HttpClientSupport$SoapUIHttpClient] Attempt 1 to execute request
at com.eviware.soapui.impl.wsdl.teststeps.RestTestRequest.assertResponse(RestTestRequest.java:141)
at com.eviware.soapui.impl.wsdl.teststeps.RestTestRequest.setResponse(RestTestRequest.java:128)
at com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep.run(RestTestRequestStep.java:809)

Can’t find a method to solve this even google more, finally got it, update ‘poi-ooxml’ to the latest version in pom.xml.

1
2
3
4
5
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.15</version>
</dependency>

Jenkins create job display blank page

Posted on 2016-11-18 | In Jenkins |

After upgrade jenkins to latest version, i was not able to create a new job and while clicking the ‘New Item’ it directs to a blank page.

Solution:
Checked the error message, should be the plugin version issue, it works after i upgrade plugin to latest version.

You can try this method if you also encounter this issue, this may or may not help you^_^

SoapUI - property transfer between test cases

Posted on 2016-11-09 | In SoapUI |

When doing Restful API automation with SoapUI, case calling another case is very usually, here i did a little research, just a start.

Simple Demo

This demo is: login system, get the authorization token, then get the calendar list.

  1. Create a test suite and a test case, and add the login request.
  2. To get the correct format authorization token.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    import groovy.json.JsonSlurper
    import groovy.json.*

    def response = context.expand( '${Login#Response}' )
    def JsonSlurper jsonSlurper = new JsonSlurper()
    def Object result = jsonSlurper.parseText(response)
    def token = result.token
    def authorization = "Bearer "+token

    return authorization
  3. Transer property to getCalendar request.

Run TestCase

From demo we can see, the login request adding in get calendar API, in this way, we will adding login request in each test case. if the login request change someday, we need to update all test cases, not easy to maintain, so here we can separate login request to another test suite.

  1. Separate login test suite.
  2. Set customized token to a property use Groovy.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    import groovy.json.JsonSlurper
    import groovy.json.*

    def response = context.expand( '${Login#Response}' )
    def JsonSlurper jsonSlurper = new JsonSlurper()
    def Object result = jsonSlurper.parseText(response)
    def token = result.token
    def authorization = "Bearer "+token

    testRunner.testCase.setPropertyValue("token", authorization)
  3. Setup get calendar test suite.

  4. Add ‘Run TestCase’ in test case.
  5. Add token(return from ‘Run TestCase’ step) to get calendar request.

Groovy Script

Use ‘Run TestCase’ method, it’s not easy to determine which user to login, need to maintain in the login suite, the best is to pass user/pwd from get calendar request, and here we go.

  1. In get calendar case, we use groovy script to run login request instead of Run TestCase.
    In CaseB > getCalendar > Login

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    import com.eviware.soapui.support.types.StringToObjectMap

    // get your test case
    def testCase1 = testRunner.testCase.testSuite.project.getTestSuiteByName("CaseA").getTestCaseByName("pass")

    // set the user and password properties in the context
    context.setProperty("Login_userName","yongfei.hu")
    context.setProperty("Login_password","Beyond@123")

    // run the testCase
    def contextMap = new StringToObjectMap( context )
    testCase1.run(contextMap,false)

    // return the token value
    return testCase1.getPropertyValue("token")
  2. Then need to update the pass parameter to login request.

  3. Add token(return from ‘Login’ step) to get calendar request.

SoapUI - change endpoint for TestCase

Posted on 2016-10-15 | In SoapUI |

在用SoapUI时,会碰到baseUrl改变的情况,需要对所有的Case修改成最新的endpoint。

我们可以在Project中统一的变更来实现:

  1. 在Project Tab中双击左侧导航栏的Service URL;
  2. 选择‘Endpoints’;
  3. 修改Endpoint。

日日新儿童绘画课

Posted on 2016-10-06 | In 丁丁 |

一直吵着要学画画,去年等了一年也没有开国画的班,今年还是开不起来,总算报了儿童绘画的班,玩的开心就好。

以下作品仅做留念。




Read more »

逛植物园

Posted on 2016-10-02 | In 丁丁 |

这个国庆不是严重雾霾,就是连绵阴雨,就好了一天,挣扎着去了植物园,正好赶上了这唯一的好天。

小丁大概两岁的时候来过一次,来去匆匆,都没来得及好好看看。以前总觉得植物园有啥好看的,这次感受就不一样了,确实是挺漂亮的一个地方,环境好,植物种类也很多,玩的人很多,比想象的要漂亮的多。




Read more »

做性能测试时,怎么判断网络带宽够不够

Posted on 2016-09-12 | In Performance Testing |

简单记录一下怎么判断网络带宽对性能测试的影响。

注:100Mbps = 12.5M/s,带宽是bps

  1. 压力机和服务器之间的真实带宽
    这个一般自己来测试一下,可以用工具iperf, 详细请看:iperf

    这样,就可以获得二者之间的带宽为393M/s

  2. 单个用户跑业务的吞吐量的平均值
    假设跑完后的平均值是1000k,那需要的带宽就约是8M;若是想跑100个用户就需要800M,根据第一步测试的结果实际带宽是393M,所以是跑100个用户带宽是不够的。

去了N次的北京动物园

Posted on 2016-08-28 | In 丁丁 |

小朋友自己的计划是抽出一天去动物园玩,玩的很开心,每一次都有不周的收获,认识不同的动物和习性。

在儿童乐园还认识了一个叫贝贝的小朋友,长大了,到哪都能找个小朋友玩,希望你以后还能这么的开心,能找到你的好朋友。


Read more »
1…212223…40
唐胡璐

唐胡璐

i just wanna live while i am alive

393 posts
42 categories
74 tags
RSS
LinkedIn Weibo GitHub E-Mail
Creative Commons
© 2022 唐胡璐
Powered by Hexo
|
Theme — NexT.Pisces v5.1.4