4

Please note this question is related to Selenium.

Before a HTML form submit i.e., selenium.click("//button[@type='submit']");

I want to inject a name value pair at native level in the HTTP Post back to the Server e.g.

Change HTTP Post from:

POSTDATA=register=true&accountType=customer

To:

POSTDATA=register=true&accountType=customer&mynewfield=true

Working with Selenium commands its not obvious how to intercept and modify what is posted back to the server.

Any ideas of how to achieve desired result in Selenium or something that can be called from Selenium? Kindly appreciated NJ

1 Answer 1

1

In theory you could use javascript or jQuery to alter the page. For example, using jQuery you could add a hidden form element with a default value or pre-set value that will then be passed upon form submission. (if i understand your question right - emulating TamperData?)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.