P S
P S

Reputation: 158

get element text for web service in robot framework

From below soap response, if I want only the customdata part i.e ABCD1234564754 as the response, which keyword should i use.

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

As of now, I have written below code:

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

I want ${GetABCURLResult} set to ABCD1234564754

Upvotes: 1

Views: 782

Answers (1)

ArunGahlawat
ArunGahlawat

Reputation: 88

You can use Split String with separator 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}

index zero will have all unnecessary data, index 1 will have your desired result.

Upvotes: 0

Related Questions