Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Executing JSON in Selenium

I need to know the easiest way to execute JSON in a selenium test. An example would be i want to POST { "UserId":"234234" } and test against what is returned. Currently using Advanced REST client chrome app to manually test. I've done a lot of searching on this topic but haven't come across any good examples.

like image 574
AJ_Cemprola Avatar asked May 20 '26 15:05

AJ_Cemprola


1 Answers

This doesn't sound like it's best solved by selenium. With Selenium you would interact with the form to get that value to post, and handle the subsequent AJAX response / page refresh. If you wish to POST data you should look at a library that performs those types of operations across the wire.

If you are looking for a HTTP library, then Apache has a good one (Java based).

like image 136
Scott Avatar answered May 23 '26 14:05

Scott



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!