Getting queryString from GET request from website- alternative Tools then Selenium - json

Aim:
I´m testing a specific site and I want to check wheater the sent key-value-pairs are valid.
I need to get the queryString parameters (key-value-pairs) of a GET request on a website. The queryString is only accessible via the GET requests and is NOT in the url. (I want to compare these key-value-pairs from the website later with other key-value-pairs from a file/html/..etc.)
This is what I did and know until now:
I know I can visualize the K/V-pairs when using FireBug->Network->Parameters.
I can get a GET request with the Selenium WebDriver, but it is complicated to extract the queryString out of the JSON-Object. [I was using Java with jsoup and json.simple]
The only tool I know which can compare key-values on a website is Columbo.io, but I have to write the compared values manually into the tool- that is not flexible enough for my purpose.
In my research I found the following tools: PhantomJS, Ranorex, SmartBear TestComplete, Wetator, Sahi Pro, RedGlass, TestingBot, BugBuster, Canoo Webtest. I sadly cannot find out if these tools are able to give me the key-value-pairs I desire.
Problem:
With Selenium I expect to need a lot of time for writing tests, like maybe 2-4 weeks? So I am searching for other tools which can extract the key-value-pairs of a website easier or quicker.
Question:
Which tools can you recommend for getting these parameters easily?
And if there isn´t any better tool then Selenium then please tell me: maybe I´m overlooking some other issue and there are i.e. better API´s for parsing the JSON-Object to get the key-value-pairs or other things I could improve?
Are there any sites where I can read the experiences of other persons with specific tools.
PS: This is my first question here on Stackoverflow. I hope you can understand and help me.

I am not sure if I get your point correctly but if you want to play with HTTP requests and key-value-pairs, you may have a try to perform with Apache HttpClient which can be integrated with your Selenium-Webdriver java. Hope it can help.

Related

How to get change in HTML DOM in LabVIEW?

I am doing IOT related project in Labview using Arudino as hardware.
I was able switch off/on an led on Arudino by Pressing OFF/ON on website by using datasocket vi. Now what i want is to control the intensity of led from Website.
I have a range slider in my website and its real time value can be viewed in textarea,div,input type.
Is there any way i can get that real time value that is being changed in HTML DOM in Labview.
I know that datasocket vi returns the html source code but not the HTML DOM.
I dont want to use the Web Publishing Services as they dont work in my Laptop.
This is the link im referring for datasocket.
Datasocket Labview
You can do something like creating a web socket, but I expect the easiest thing is to use a web service. You can create one in LV and add a setLEDIntensity method to it and call it from your JS code. You can find a simple example here and in other documents in that community.
Use WebSocket API for LabVIEW to send and receive data from the web. This is the best option for you.
https://decibel.ni.com/content/docs/DOC-40572

JSON to blueprint/MSON

I havent been able to find any tools for this conversion, does anyone know of any that exist.
Currently, I have JSON data from Swagger that I would like to convert to Blueprint/MSON to use with Apiary, but I am not sure if this is possible. Any recommendations would be super helpful, or suggestions for other routes to try and onboard my API to Apiary without manually writing it.
There is one here: MSONGenerator. Takes a while to load, but you paste your JSON and get nice MSON out of it. No source code for it as far as I can see, but I didn't look very far.
There's also mson-to-schemas, an npm package. I have no experience with it.
Source: API Blueprint tools section

Where is the Data stored on Website

I am at this website -
http://www.zoominfo.com/s/#!search/company/1.64.eyJjb21wYW55TmFtZSI6xIB2YWx1xIw6ImEiLCJpc1VzZWTEjXRyxJN9fQ%3D%3D
If you see the company name - Agilent Technologies Inc.
Its neither there in page source, nor in any json format.
But it does show in the Dom of Chrome Developer tool.
I have looked and analysed almost every requests that it sent, but still couldn't find where this data is saved.
By where the data is saved - I am looking to find where I can scrape that data from?
If by using python-requests and BeautifulSoup
I do see an XMLHTTPREQUEST made, not sure what that means, or if that is the clue to my answer.
I am still learning python, and it would be a very useful information if someone helps me with this.
Thanks in advance.
After the HTML is loaded, js requests for the data through an XMLHTTPREQUEST which is loaded right after the request is received on your client. That's why you see the DOM element right there using element inspector.
You didn't mention what goal you want to achieve or what tool you are using. Please be specific on your question. If you do not have any idea about this kind of pattern, google out angularjs, see some example.
do see an XMLHTTPREQUEST made, not sure what that means, or if that is the clue to my answer.
It means that javascript embedded in the page is sending an extra HHTP request to the web server. It is likely that the "Agilent Technologies Inc." text is being returned in the server's response to that request, and the javascript in the page is then injecting the text into the DOM in the appropriate place.
Where is the Data stored on Website
That is a completely different question ...
(You have already noted that the data (e.g. the company name) gets injected into the page displayed by your browser.)
On the server side, the data could be stored in the web server (or its back-end systems) in a variety of ways. Or it might not be stored at all. There is no way of knowing ... without looking at the server-side code and configurations.

Chrome extension and mysql

I am trying to develop a chrome extension.
Users have to send data to my server and receive data from my server.
I am new to chrome extension and I find the javascript cannot access the database. e.g MYSQL
I really don't know where to start?
I check the xmlhttprequest, but I still have no idea. Can anyone give me some more hints and suggestions?
If you can provide a sample code, this would be really helpful!
I am searching on the Internet for two days and totally get lost....
Thank you for your help!
You should create web-script with php, python, ruby etc
There you should provide a connection to mysql and process the data and print your result as JSON, for example.
Then you should get that json with ajax request by your chrome extension and process this json with your js code.

Using Wordpress's JSON API with W3 Total Cache

Using the excellent Wordpress plugin, JSON API, I've created an application that retrieves fresh data by visiting a URL along the following lines, doing a Unix curl dump.
http://www.website.net/?json=get_recent_posts&post_type=tree&count=200
The problem is this: Because the site delivers cache versions using W3 Total Cache, the stuff that gets curled is inconsistent. Sometimes I get the JSON that I need. Other times I just get a cache showing me "website.net"'s front page, without the effects of the query string.
I'm hoping to do one of two things:
1) Find a way for my request to bypass w3 Total Cache. But how? Is there something I can put into the query string that will tell Wordpress to give me a fresh page read and not a cache?
If that can't work,
2) Get the plugin data through PHP rather than through the RESTful Web request. But I only know how to use JSON API for Web URL calls and not for using the JSON data internally.
Any help much appreciated. I also thought that maybe W3TC's function to cache query string results might work, but I can't figure it out.
If you are using page cache using disk enhanced in w3tc settings, the URL with query strings will not cached. I think this solves your problem.