0

Can anyone assist me to solve this query in the below mentioned scenario…? first of all i’ve created a testsuite for every individual web service, for handling all types of its respective testcases like, request succeeded, internal server error bla bla. My app is login based. and on successful login, login API returns session id and some other values in the response. ive another suite which fetches the latest studies from the server for that sessionid which is generated as a response in testsuite 1. Can you help me to use this property (sessionid ) as a param while invoking the other APIs (for instance, getlateststudies) being the part of other testsuites….in this case i want to fetch the latest studies for that sessionid. As you know that values for such params, like, sessionid is system generated. so can the wild character (*) be sued in this case. Im sort of new to SOAPUI , have already taken help from soap UI online help links but the entire help is related to using the property as a param in the same testsuite and NOT across the various testsuites. Please elaborate all the steps if you know how to proceed ahead. for more clarity , let me the define the hierarchy which i’ve structured in my workspace. Userlogin /testsuite 1, represents the login API/ Request succeeded /testcase name , represents a scenario/ teststep1 method1-request1 /This testcases returns system generated sessionid as a value upon invoking/ getlateststudies /*test suite 2, represents the API to fetch the latest studies from server for that sessionid */ Request succeeded /testcase name , represents a scenario/ teststep1 method1-request1 Do i need to use any groovy script for it ? I’ve already tried using property transefer feature of soap UI within the same testsuite but tell me some suitable solution to use it across the test suites of the same project.


@ Steve, Thanks for ur reply. i actually followed the steps mentioned in the 2nd most link provided by you as per my last conversation with you, the sessionid param is a server generated id and it couldn't be hard coded.Just want to discuss with you what i did!i defined a property at the project level sessionid and imported its value from an external source, say .txt file and in which ive saved the value of sessionid with a wild character , i-e, *. keeping in view the fact that it will pick the server generated sessionid and i really didn't want to pass the hard-coded value. i later made use of property transfer feature to select the source and target properties names and their values. want to double-check with you is my approach correct , if not , then please provide your valuable comments! or if passing the wild card character is not correct for the server generated id , then what should be the other possible option to represent this ?

4

1 回答 1

1

您很接近,听起来您只是使用了错误的属性类型。soapUI 有几个级别。

  • 全球 - 全球可用
  • 项目 - 在整个项目中可用
  • TestSuite - 可在整个套件中使用
  • TestCase - 在测试用例中可用

您需要使用属性转移到项目级别属性,因此在项目级别添加自定义属性,然后使用属性转移到您创建的该属性。使用 xpath 提取您需要的数据。最后,您需要在新请求 ${#Project#PropertyName} 中使用该项目属性

将这些组合在一起的所有工具都可以从soapUI 网站获得。

http://www.soapui.org/Functional-Testing/xpath-and-xquery-assertions.html#1-the-xpath-match-assertion

http://www.soapui.org/Functional-Testing/working-with-properties.html

http://www.soapui.org/Functional-Testing/transferring-property-values.html

于 2012-07-26T02:19:47.250 回答