Package org.apache.jmeter.protocol.http.sampler

Examples of org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.addArgument()


      String html = "location: http://server.com/index.html" + "?session[33]=jfdkjdkf%20jddkfdfjkdjfdf%22;";
      response = new SampleResult();
      response.setResponseData(html.getBytes());
      mod.setArgumentName("session[33]");
      HTTPSamplerBase sampler = createSampler();
      sampler.addArgument("session[33]", "adfasdfdsafasdfasd");
      context.setCurrentSampler(sampler);
      context.setPreviousResult(response);
      mod.process();
      Arguments args = sampler.getArguments();
      assertEquals("jfdkjdkf jddkfdfjkdjfdf\"", ((Argument) args.getArguments().get(0).getObjectValue())
View Full Code Here


        } else if (tag.equalsIgnoreCase("textarea")) { // $NON-NLS-1$
          try {
            url.addEncodedArgument(getAttributeValue(nodeAtts, "name")// $NON-NLS-1$
                tempNode.getFirstChild().getNodeValue());
          } catch (NullPointerException e) {
            url.addArgument(getAttributeValue(nodeAtts, "name"), ""); // $NON-NLS-1$
          }
        } else if (tag.equalsIgnoreCase("select")) { // $NON-NLS-1$
          selectName = getAttributeValue(nodeAtts, "name"); // $NON-NLS-1$
        } else if (tag.equalsIgnoreCase("option")) { // $NON-NLS-1$
          String value = getAttributeValue(nodeAtts, "value"); // $NON-NLS-1$
View Full Code Here

            String html = "location: http://server.com/index.html" + "?session_id=jfdkjdkf%20jddkfdfjkdjfdf%22;";
            response = new SampleResult();
            response.setResponseData(html, null);
            mod.setArgumentName("session_id");
            HTTPSamplerBase sampler = createSampler();
            sampler.addArgument("session_id", "adfasdfdsafasdfasd");
            context.setCurrentSampler(sampler);
            context.setPreviousResult(response);
            mod.process();
            Arguments args = sampler.getArguments();
            assertEquals("jfdkjdkf jddkfdfjkdjfdf\"", ((Argument) args.getArguments().get(0).getObjectValue())
View Full Code Here

            String html = "location: http://server.com/index.html" + "?session_id=bonjour+monsieur";
            response = new SampleResult();
            response.setResponseData(html, null);
            mod.setArgumentName("session_id");
            HTTPSamplerBase sampler = createSampler();
            sampler.addArgument("session_id", "adfasdfdsafasdfasd");
            context.setCurrentSampler(sampler);
            context.setPreviousResult(response);
            mod.process();
            Arguments args = sampler.getArguments();
            assertEquals("bonjour monsieur", ((Argument) args.getArguments().get(0).getObjectValue())
View Full Code Here

            response = new SampleResult();
            response.setResponseData(html, null);
            mod.setArgumentName("session_id");
            mod.setEncode(true);
            HTTPSamplerBase sampler = createSampler();
            sampler.addArgument("session_id", "adfasdfdsafasdfasd");
            context.setCurrentSampler(sampler);
            context.setPreviousResult(response);
            mod.process();
            Arguments args = sampler.getArguments();
            // System.out.println(((Argument) args.getArguments().get(0).getObjectValue()).getValue());
View Full Code Here

            String html = "location: http://server.com/index.html" + "?session[33]=jfdkjdkf%20jddkfdfjkdjfdf%22;";
            response = new SampleResult();
            response.setResponseData(html, null);
            mod.setArgumentName("session[33]");
            HTTPSamplerBase sampler = createSampler();
            sampler.addArgument("session[33]", "adfasdfdsafasdfasd");
            context.setCurrentSampler(sampler);
            context.setPreviousResult(response);
            mod.process();
            Arguments args = sampler.getArguments();
            assertEquals("jfdkjdkf jddkfdfjkdjfdf\"", ((Argument) args.getArguments().get(0).getObjectValue())
View Full Code Here

                "<a href=\"#\" onclick=\"$(\'frame\').src=\'/index?param1=bla&sessionid=xyzxyzxyz\\'";
            response = new SampleResult();
            response.setResponseData(html, null);
            mod.setArgumentName("sessionid");
            HTTPSamplerBase sampler = createSampler();
            sampler.addArgument("sessionid", "xyzxyzxyz");
            context.setCurrentSampler(sampler);
            context.setPreviousResult(response);
            mod.process();
            Arguments args = sampler.getArguments();
            assertEquals("xyzxyzxyz", ((Argument) args.getArguments().get(0).getObjectValue())
View Full Code Here

  /**
   * A unit test for JUnit.
   */
  public void testSimpleFormParse() throws Exception {
    HTTPSamplerBase config = makeUrlConfig(".*index.html");
    config.addArgument("test", "g.*");
    config.setMethod(HTTPSamplerBase.POST);
    HTTPSamplerBase context = makeContext("http://www.apache.org/subdir/previous.html");
    String responseText = "<html><head><title>Test page</title></head><body>"
        + "<form action=\"index.html\" method=\"POST\">" + "<input type=\"checkbox\" name=\"test\""
        + " value=\"goto\">Goto index page</form></body></html>";
View Full Code Here

  /**
   * A unit test for JUnit.
   */
  public void testBadCharParse() throws Exception {
    HTTPSamplerBase config = makeUrlConfig(".*index.html");
    config.addArgument("te$st", "g.*");
    config.setMethod(HTTPSamplerBase.POST);
    HTTPSamplerBase context = makeContext("http://www.apache.org/subdir/previous.html");
    String responseText = "<html><head><title>Test page</title></head><body>"
        + "<form action=\"index.html\" method=\"POST\">" + "<input type=\"checkbox\" name=\"te$st\""
        + " value=\"goto\">Goto index page</form></body></html>";
View Full Code Here

            urlConfigs.add(createFormUrlConfig(tempNode, context));
          } catch (MalformedURLException e) {
            inForm = false;
          }
        } else if (tag.equalsIgnoreCase("input")) {
          url.addArgument(getAttributeValue(nodeAtts, "name"), getAttributeValue(nodeAtts, "value"));
        } else if (tag.equalsIgnoreCase("textarea")) {
          try {
            url.addArgument(getAttributeValue(nodeAtts, "name"), tempNode.getFirstChild().getNodeValue());
          } catch (NullPointerException e) {
            url.addArgument(getAttributeValue(nodeAtts, "name"), "");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.