2017-06-22 25 views
1

从soap响应下面,如果我只需要customdata部分,即ABCD1234564754作为响应,我应该使用哪个关键字。在机器人框架中获取Web服务的元素文本

$ {ABC} = https://test.com/i?formid=5Z0C&customdata=ABCD1234564754

截至目前,我已经写了下面的代码:

Call Soap Method GetABCURL ${GetABCURL} 
${soap_response} Get Last Received 
Log ${soap_response} 
${GetABCURLResult} = get element text  ${soap_response} 

我想$ {GetABCURLResult}设置为ABCD1234564754

+0

使用get元素的文字,我得到的所有文字,我只想 –

回答

0

您可以使用Split String与分离器as customdata=

${abc}= Set Variable https://test.com/i?formid=5Z0C&customdata=ABCD1234564754 

${xyz} Split String ${abc} customdata= 

${customdata} Remove String ${xyz[1]} </WEB> 
Log To Console ${customdata} 

索引零将会有所有不必要的数据,索引1将会有你想要的结果。

+0

的CustomData我的网址在以下格式 https://test.com/i?formid=5Z0C&customdata=ABCD1234564754 使用拆分字符串给我ABCD1234564754。我不想要 –

+0

最简单的方法将删除尾随 '$ {customdata}删除字符串$ {xyz}' 它将删除所有出现的WEB。 可以有单线解决方案,但这将是最简单的一个。 – Gahlawat