How to take URL from SOAP response. And hit using selenium

349 views
Skip to first unread message

Vishal Pachpute

unread,
Jul 22, 2016, 4:30:16 AM7/22/16
to seleniu...@googlegroups.com
Hi

I have following scenario.

- Hit the SOAP request . (Change different parameters and hit)
- Then URL is generated in SOAP response.
- Copy this URL from SOAP response and hit using Selenium Webdriver.
- Verify the different parameters provided in SOAP request are shown on web page. (When URL is hitted which is generated in SOAP response)

So can anyone please suggest what approach should I follow.

Your help is really appreciated.

Regards
Vishal Pachpute

Malith Lakmal Karunaratne

unread,
Jul 22, 2016, 3:04:10 PM7/22/16
to Selenium Users
you can use a programming language(may be java) to send the soap request and capture the url from response. Then use it with selenium web driver.

Vishal Pachpute

unread,
Jul 25, 2016, 2:58:48 AM7/25/16
to seleniu...@googlegroups.com
Hi

You mean hitting REST client using web driver ?

Can you please provide me any sample code if you have

Your help is really appreciated. Thanks in advance.

Regards
Vishal Pachpte

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/43a9ce14-eb76-418d-b57c-00e161f1c409%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mallik H

unread,
Jul 25, 2016, 9:38:21 AM7/25/16
to Selenium Users
Can you give try?

import com.eviware.soapui.impl.wsdl.WsdlProject;
import com.eviware.soapui.model.iface.MessageExchange;
import com.eviware.soapui.model.support.PropertiesMap;
import com.eviware.soapui.model.testsuite.TestCase;
import com.eviware.soapui.model.testsuite.TestRunner;
import com.eviware.soapui.model.testsuite.TestSuite;
import org.junit.Assert;
import java.util.List;
public class SoapUITest
{
  public final static void main(String [] args) throws Exception {

    WsdlProject project = new WsdlProject("C:\\WebService\\WebServiceTest\\src\\main\\java\\weather.xml");
    List<TestSuite> testSuites = project.getTestSuiteList();
    for (TestSuite testSuite: testSuites)
    {
        System.out.println("Running Test Suite: "+ testSuite.getName());
        List<TestCase> testCases = testSuite.getTestCaseList();
        for(TestCase testCase:testCases)
        {
            System.out.println("Running Test Case: " + testCase.getName());
            WsdlTestCaseRunner runner = new WsdlTestCaseRunner((WsdlTestCase) testCase, new StringToObjectMap(testCase.getProperties()) );
for(TestStep testStep: testSteps){
      //calling the above get method here
      String response = runStepAndGetResponseContent(runner, testStep);
      System.out.print("Received response is :" + response);
}
            Assert.assertEquals(TestRunner.Status.FINISHED,testRunner.getStatus());

            //Exception in the below line
            //System.out.println(((MessageExchange)testRunner).getResponseContent());
        }
    }
    System.out.print("Testing finished successfully");
Reply all
Reply to author
Forward
0 new messages