Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
628 views
by Contributing Tester (12 points)
retagged by

Im new in robotframework
I have 2 web services the first is the login service. The second Web Service that is another service.

When I try to access the second web service I think that the session is lost

The connection only passes through the principal that is the first one where the method for login.

My code:

Create Session and login

 ${resp}=      Get Request      cyber      /     allow_redirects=true
 ${proxies}= Create Dictionary http=${PROXY} -<<<< parameters is in resource file.
Create Session cyber ${URL} debug=1 proxies=${proxies}

log    ${resp}


${session_var}=     Head Request     aaaa   /     allow_redirects=true      

  ${headers}=    Create Dictionary    Content-Type    application/json
 ${session_cokie} =    Create Dictionary    set-cookie    ${resp.headers['set-cookie']}     
 ${sess_header}=    Create Dictionary    set-cookie    ${resp.headers['set-cookie']}
 ${session} =    Create Session    session1    ${PROXY}    headers=${sess_header}    cookies=${session_cokie}

 @{arrheaders}=    Split String      ${resp.headers['set-cookie']}     =  
 #@{arrheaders}=    Split To Lines     ${resp.headers['set-cookie']}    -1
 ${jSession}=       Create Dictionary    @{arrheaders}[0]         @{arrheaders}[1]   


 #${reply}=    Get Request    session1    /mz/p/v1/troubleshoot/ping    headers=${sess_header}

 ${idSecurity}=  Create Soap Client  ${CURDIR}\\SecurityServiceService.wsdl   &lt;---first web service
 Set Proxies     http     ${PROXY} 
 Set Headers  ${session_cokie}

 ${idUtil}=  Create Soap Client    ${CURDIR}\\UtilServiceService.wsdl   &lt;----second web service
 Set Proxies     http     ${PROXY}
 Set Headers   ${session_cokie}




 Switch Soap Client        ${idSecurity} 
 ${result}=       Call Soap Method        authenticateUserInternalSecurity      ${USERNAME}    ${PASSWORD}     1   method first web service

 Switch Soap Client        ${idUtil}     
 ${result}=     Call Soap Method     getIfxodate     &lt;---method second web service i cannot to access here,  it does not happen and I do not know why

Switch Soap Client        ${idSecurity}  
${result}=       Call Soap Method        logOutUser   &lt;---logout method of first ws this is ok. 

delete all sessions

EDIT: the robot give me this error: "Operation: getIfxodate called without a valid session."

Regards!

closed with the note: question is not much clear
by Expert (572 points)
Your question is not much clear. Can you please brief what you are trying to do? Also, your code is not much readable.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...