Current time: 08-15-2020, 06:42 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting in RESTful API's
06-04-2014, 08:29 AM
Post: #1
Scripting in RESTful API's
Anyone figure out how to login and access deeper pages using the RESTful API? I understand you can do scripting, but I am a bit confused on how to incorporate it into my project.

Currently I am using Python-Selenium to start the RESTful API and appending all the parameters. I am familiar with steps in Selenium to crawl through the website, but using a one string action, I do not get how this would be performed. Basically I have a login button, that takes you to a new URL with a redirect back, making this step more complicated.

Any ideas would be a big help!
Find all posts by this user
Quote this message in a reply
06-05-2014, 12:39 AM
Post: #2
RE: Scripting in RESTful API's
Sorry, I have no idea how you'd use Python-Selenium with the REST API but scripts should be easy enough. First, get it working on manually submitted tests to make sure the script does what you want and then when you have a working script you just pass that to the REST API as the "script" parameter. If you are making GET requests to the API just make sure to urlencode the script and it should just work.
Visit this user's website Find all posts by this user
Quote this message in a reply
06-05-2014, 01:45 AM
Post: #3
RE: Scripting in RESTful API's
Hi, I am using Selenium (Python API) in two instances, one script, so I can process info needed from the tested website (i.e. get recent cookies). Then I use PhantomJS webdriver (within Selenium) to launch the REST API with a json returned data. From that point, I can continue the script to download csv or xml.

As for passing in the "script" I believe I got it last night, but if I have issues it will likely be urlencode that you recommended. Once I get it working I will update my progress, thanks for the response.
Find all posts by this user
Quote this message in a reply
06-05-2014, 06:14 AM
Post: #4
RE: Scripting in RESTful API's
Hi Patrick,

I was able to get everything working after using your built in "script" DOM navigation, rather than passing cookies. And I am now working out a way to write readable "script", then process into url-encoded as suggested. Thanks for all the work you are doing here, awesome tool and community!
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)