I am new to api automation and trying to understand few things. I have a web application and it has its APIs exposed for all basic functionality. But this product is also localized in other foreign languages.
My understanding:
The same APIs are used for all languages. APIs actually test functionality and not the UI. For most cases I need not test these APIs again for other languages.
My question:
Is it possible that there would be separate APIs exposed for different locales?
Or can I pass different locale(foreign language) strings as parameters to the same APIs?
Usually it's not the best practice to expose the various API for the different locales. The API that affected from the language may includes the language id. In this case the internal code may take in the consideration the different languages. Then you have to provide in your tests some variations of such language id.
Other case that you have to consider, the API that includes the strings as the parameter. In this case you will test the strings written in the different languages . Especially you should take in the account the Asia languages like Japanese and Chinese and right to left languages like Arabic and Hebrew.
Related
From my understanding, these two words are used almost interchangeably to refer to code that allows people to use a particular programming language to interact with an API. For example, many Python packages are labeled API wrappers or SDKs while providing essentially the same functionalities.
However, I am interested in hearing all of your opinions regarding the semantics of these two words.
I have a requirement to automate testing for an API SDK written in 5 programming languages.
The SDK is similar to jira SDKs.
Writing Tests across all 7 languages will lead to duplicating testing logic in all programming languages.
I want to find a way to call the SDK methods (which are basically API calls internally) from different programming languages in any one language (preferably python) and compare the response with the public api call (SDKs being wrappers for these public APIs.)
So far I have thought of creating a rest server in all languages (wrapper APIs over the SDK methods) and call these wrapper APIs to get the response and then proceed with comparison
I am wondering how the industry soles this problem in general and if there is a simpler solution to this problem which does not involve creating wrapper APIs for SDKs from different languages.
I'm trying to get an initial understanding of what a full Elm application looks like. In particular what the "stack" looks like. As a concrete example, let's say I have a website that allows users to register/login and then upload pictures and comment on others' pictures and comments. It delivers HTML, JavaScript, and CSS, and uses PHP and/or Perl on the server, The PHP/Perl interacts with MySQL or Oracle. If I were to re-develop this site with Elm, what parts does Elm handle and what are the common/recommended choices for the rest of the stack?
Elm handles the frontend responsibilities. You can use it instead of javascript and use its libraries to generate the needed html & css.
For backend you can use whatever technology you want. Since Elm is a functional language, some people chose a functional language for the backend too. Most frequent I've seen are Elixir (Phoenix Framework) and Haskell.
Take a look at Tour of an Open-Source Elm SPA for a real world example of implementing an Elm frontend for an already available backend.
Elm is purely the front-end, so you won't need any php to create html code.
It provides broad coverage of standard HTML, but excludes service workers and some other modern web APIs - you can use javascript through Elm's foreign function interface (called Ports).
Elm has out of the box support for json from a REST environment, and powerful parsers if you need to use something else (e.g. xml). As Peter suggest, you might want to use a functional backend, but there is absolutely no necessity (I've Elixir and Node with success to date).
Both API and IDL act as an interface between two components of software and play the role of bridge between two components of software or between two software.
What is the difference between them?
API is a concept. It is any external programming interface that a piece of software exposes so that it can accept external input from some other software, run some logic, and provide output. Usually when we talk about API's, like Facebook's Graph API, or the Windows API, we are talking about the types and logic contained within those API's, and how they can be used.
IDL, as the tag says, is a language you can use to describe a API, in a manner that other software may understand. It is platform independent, so can be used to facilitate integration. More information about this language is vastly available if you search for it ;)
This is probably a pretty basic question, but are APIs language specific. In General, do certain languages only work with certain APIs or should any language be able to talk to any API.
Specifically, Bing Webmaster Tools API has code example in C#. Does that mean I can't access the API in Python?
Thanks in advance!
If an API is exposed via HTTP and returns a language-neutral format like JSON or XML (which most popular third-party APIs do) then there's no restriction on what programming language you can use to parse the API responses.
Some API providers may provide specific client libraries e.g,. The Facebook JavaScript SDK, but this doesn't preclude using a different language, it just means you'll get less support in doing so.
An API always relates to just one language. However, sometimes interfaces or libraries are created so that they can be accessed by other languages. For example, XML is used for specifying listings in ebay. It is uploaded via HTTP. However there are many libraries, such as for PHP and Java, that abstract that into their terms, but keep a direct correlation between their usage and the XML they send.
It depends. Many APIs are designed for use with one particular language, for example functionality provided by a PHP framework. Having said that, it does not necessarily mean that in the future another language could start using them; for example IronPython making use of the .NET Framework.
It is very common for compiled libraries to be used by multiple languages, e.g. graphics libraries.
You can also have web-service based APIs (e.g. Bing in your example) which respond to HTTP requests. These could be invoked by any language, or anything in general.