The thesis might seem controversial in 2021 when in many rankings such as TIOBE, Java seems to be slowly overtaken by languages such as Python. However, despite the changes due to growth of areas in IT in which Java has never dominated (for example data analysis), there is no premise that in systems where this language is most popular it will be displaced. Listed below are some reasons why, in my opinion, Java still holds such a strong position today.
With 14 years on the market, we have gained valuable expertise in various areas. Read more about what we excel at.
Being the first is why Java remains so strong
In many ways, Java was a precursor of programming based on compiling language into intermediate code. The concept itself wasn’t new, as the first language to use this approach was Smalltalk developed in the 70s, but due to limitations in hardware and the nature of the syntax, it didn’t gain as much popularity.
The fact is that when Java was released, it had few elements that were revolutionary, but the key to its success was combining those elements in the right way and learning from predecessors’ strengths and weaknesses. Microsoft later used this approach in developing C# by utilizing Java’s experience.
On one hand, the syntax based strongly on C++ which was the most popular language in the general-purpose category at the time, made the migration very easy for its users. Also it simplified many elements such as memory management via garbage collector or optimizations via Just in Time compiler. In addition, it gave a set of predefined tools and components in JDK.
This attracted many users at Java’s launch and boosted the start of this technology. Even now, the number of programmers skilled in this language is a common reason for choosing it for a project from a business perspective.
Backward compatibility as one of the strengths of Java
This is a big advantage, especially for systems with long-term support. Thanks to this policy, the language avoided perturbations known to programmers for example from Python 2 to 3 migration.
An approach like that doesn’t just affect syntax, it is even more explicit on the virtual machine level, as evidenced by the fact that from the beginning of existence to the Java 8 release, only 2 instructions were added to the bytecode on the virtual machine. This of course doesn’t make migrations between versions costless but it certainly reduces their complexity.
Such an conservative approach creates yet another non-obvious advantage. Java is not a syntax sugar laden language, which on one hand makes many things impossible to do in a very short way. On the other hand though, this verbose approach in many cases makes code refactoring easier, without a very high level of necessary knowledge.
In other words, badly written code is easier to read and fix in Java than in more complex languages.
Java can be easily integrated with a variety of tools and libraries
Here comes probably the biggest advantage of the discussed language – its age. Because of it, Java encourages maturity of solutions and has a large community. It’s hard to find technologies without prepared integration with Java or functions that aren’t provided by external libraries.
An important attribute of Java is that although the syntax evolves slowly, progress of tools is fast enough to never deviate from current trends.
A good example of this is the transformation that the Java systems underwent through the creation of the Spring framework. It greatly improved the development of enterprise systems, especially in relation to Java EE. Huge evolution was also made in other areas as well, such as tools for managing dependencies and building. The Java community has gone from requiring complete manual configuration Ant to much more convenient and automated solutions like Maven and Gradle. In other words, it is an ecosystem that is alive and evolving.
Another important feature is the independence of choosing languages compatible with Java as it allows one to benefit from the toolset without using Java syntax. Apart from Java itself, alternatives include the increasingly popular Kotlin, dynamically typed Groovy or more functional and competing mainly in the big data area Scala. There is no shortage of opinions that Java may at some point move into the role of “assembler for the JVM,” giving way to current alternatives within the same technology stack.
After 26 years of existence, the position of Java on the market seems to be unthreatened. The technology stack based on it constantly adapts to new trends, allowing to start new projects based on it without lagging behind solutions offered by the competition. It is still attractive enough to be the first chosen language for many programmers.
Low code no code movement is on fire right now. You can ask why? The answer is simple – the way developers build simple things is changing faster than you think. We assume that this hype is the real deal and soon there will be another branch of employees on board at different IT companies around the world who will specialise in just that.
The low code no code movement is just beginning to get more attention, but we have closely observed its development over the years. In the following article, we are sharing all of the details you need to know about this topic. Grab a cup of coffee or tea and read more below.
Low code no code movement – what is that?
Low code no code movement is an approach to software development that reduces (or sometimes completely eliminates) the amount of custom coding required to build an application.
This can be achieved with low code no code development platforms which incorporate drag-and-drop interfaces and reusable code templates into the software development process.
When it comes to low code and no code, there is a major difference.
Low code development simplifies the development process for non-developers and offers greater flexibility, but it does not eliminate the need for coding skills entirely. The ability to code is essential in this process in order to fully implement the application’s functionalities.
This need is eliminated altogether in the no code approach where the application development is limited to a drag-and-drop process. That being said, as no code development relies on pre-built editing capabilities, the features that can be built into an application are constrained.
No code tools go beyond choosing from building blocks and creating the end-product with them. In fact, some of these tools don’t even contain blocks to grab and drop in the first place. Usually, these tools are dedicated to creating particular software applications and impose certain ready-made solutions and allow you to adapt them to your situation.
Therefore, low code no code development tools and platforms can be utilized in creating digital solutions for various business and technical purposes (that of course if complex customization and functionality are not required). Low code no code can be used for creating:
landing pages
back office apps
databases
mobile apps
automation of business processes
e-commerce solutions
gaming (a good example here is Roblox)
SaaS platforms (e.g. Sharetribe)
software testing (e.g. bugbug.io)
Tools for low code no code movement
As the popularity of the low code no code movement is on the rise, we can expect more and more tools to launch in the near future. Nevertheless, there are already many useful tools that can be used. Let’s have a look at some of the most popular ones:
WordPress
WordPress is one of the most well-known CMSs and no code tools for creating media-based websites out there.
Webflow
Webflow is another example of no code solutions for building websites. However, unlike WordPress, it offers full HTML, CSS & JavaScript control as well as a custom database.
Wix
The Wix website builder is a tool that lets users create, design, manage, and develop their website’s presence without having to know how to code.
OutSystems
OutSystems is a full-stack development platform that provides a fast way to build and deliver secure, scalable applications for web and mobile.
Zapier
Zapier helps businesses build automations that connect thousands of apps without having any programming knowledge to do so. As a result, they can quickly build connections between different apps, which was previously impossible without a team of developers.
Zoho Creator
Zoho Creator can be used to create simple yet flexible business applications that help with organising and automating the employees’ work (ex. handling customer requests, registrations, customer support, sales processes etc.).
Why is the movement getting more attention right now?
The number of low code no code tools has increased significantly over the past few years. It shouldn’t surprise anyone that the movement is gaining traction considering that by eliminating coding barriers, it allows almost anyone to create innovative digital solutions.
Since the ever growing demand for web and mobile applications is not forecast to slow down any time soon, tools which can be quickly learnt and used in action to address this demand are highly appreciated, even among developers.
There’s a reason for this: coding takes time. And since many applications have a lot of common components, it is sometimes necessary to code the same elements over and over again. As a result, a lot of time can be wasted. This is where the low code no code solutions come in handy.
What is more, the road to becoming an experienced developer is long and not particularly easy. This is why a growing number of people see a huge career opportunity in the low code no code movement – by mastering a certain tool, they are able to quite quickly develop digital solutions without a lot of room for error.
Low code no code has a great deal of benefit for entrepreneurs and businesses, too. Most importantly, they can utilize low code no code to evaluate various technical business ideas without having to spend a lot of time and money on developing them with a dedicated IT team.
Furthermore, the movement encourages entrepreneurship by making it easier for small and mid-sized businesses to build websites or other products at low cost, especially in the beginning phases when budgets are usually limited.
Pros vs cons of the low code no code movement for your company
Like anything else, the low code no code movement also has its advantages and disadvantages. It might be worthwhile to examine them fully if you plan on incorporating low code no code in your company. Below we share some of the most important ones.
9 Pros of the the low code no code movement:
1. Cost and time optimization
This is especially important for businesses which, when hiring IT personnel, must spend a large piece of their budgets. Moreover, low code no code is easier to implement and the results can be seen faster while having less space for mistakes which is often the case in real-life programming.
It is worth mentioning that the low code no code tools can be also utilized by developers themselves to make their work quicker and more efficient as by doing so, they can spend less time on coding repetitive elements.
Forrester found that low code no code development helps developers make cloud-native applications more than 10-times faster (with 70% fewer resources).
2. No requirement of special developer skills (but often you still need to think like an engineer)
No previous technical background or knowledge is required to start using the no code development tools. Nevertheless, it can sometimes be helpful in the low code solutions which offer more room for customization.
3. Easier to incorporate (good and easy-to-digest online tutorials)
As low code no code tools continue to rise in popularity, so do online tutorials and manuals explaining how to effectively use them. Low code no code platforms usually have a simple structure and logic, which makes them easy to integrate and scale if necessary.
4. Utilizes visual interfaces
The movement makes it possible to create user-friendly mobile applications for customer experiences with pre-built user interface templates.
One of the benefits of low code no code is that it consolidates several stages of the software development lifecycle (e.g debugging, testing or deployment). Thanks to this, it is also possible to revert the app to previous versions if needed for better application lifecycle management.
With no code low code, you don’t need to hire a team of experts as the majority of software development tasks can be handled by one person.
6. “Out of the box functionality”
When you run a project with no code or low code, you have a well-defined set of features available to use right away. You don’t need to configure dependencies or assemble your technology stack.
No difficult decisions about which architecture layers to use are necessary. Things simply work immediately after you use them.
7. The decentralization of responsibility
With the movement, it is possible to delegate responsibilities for various areas (such as architecture, build management, database etc.) to an external provider that is an expert in this area. For instance, Webflow CMS offers hosting without the hassle of setting up databases, storage etc.
8. Easier prioritizing
If something is difficult to build with your no code, it often indicates that it is a less common need – maybe your users don’t need it? For example, you cannot easily add social sharing links in Webflow CMS but you can with custom code. However, do users actually use them?
9. Security
Additional advantage of low code no code is that the responsibility for keeping the tool secure is delegated to the provider.
7 Cons of the low code no code movement
1. Limitations and lack of total uniqueness
As low code and no code tools are essentially just tools with limited functionality and customization possibilities, they can restrict you in terms of what exactly you can build. Nevertheless, this depends on the platform of your choosing so make sure to do a thorough research beforehand.
2. Vendor lock-in
Something to consider before implementing low code no code tools is that one can find yourself in a vendor lock-in. This refers to a situation where the cost of switching vendors is so high that customers are forced to remain with their original provider.
How can this happen you might ask? There are at least a couple of ways. Not all tools offer an export capability. Even if you can export, some providers can use code that is difficult to maintain outside of their platforms. Additionally, your app might no longer be editable once you stop using certain tools.
Therefore, knowing each vendor’s export options and licensing policies is essential before purchasing a low code no code tool.
3. Lack of portability
Lack of portability might not be a major issue since most business processes and sites will be designed anyway every 3-4 years. Some low code systems like Outsystems are fully portable.
4. Security risks
Sometimes the security of the more popular tools can be compromised. Consequently, as the development process is faster it is also less structured. Because of this, if these technologies are handled by individuals without security training, risk can be introduced.
Furthermore, in the case of a hacker attack, it would be relatively easy to gain access to all solutions created with it, and the creators cannot protect themselves from that.
5. The need to pay extra for add-ons
If you wish to incorporate a low code no code tool in your organisation, you will most likely have to purchase a licence for it. Additionally, it might be necessary to pay additional fees to get premium elements in forms of add-ons etc.
6. Repetitiveness
Widgets are limited in different areas and in terms of use. Thus, this might lead to building a digital product which will be similar to other products on the market which were built using the same low code no code tool.
Low code no code platforms might impose some limitations to the possible system integrations. Hence, depending on the business needs, it is crucial to check the full functionality of the particular tool before incorporating it into the workflow.
This is not always a limitation, built in integrations are easy to use so that the back end data is more widely utilized and provides more value for the organization.
Low code no code at Espeo Software. How are we utilizing its possibilities on a daily basis?
We at Espeo leverage low code no code ourselves in a variety of ways including UX, marketing and software development.
No code in UX design
We provide our clients with advanced prototypes which we create in a no code tool called Webflow. It allows us to quite quickly build realistic simulations which help our clients validate the user experience of their apps.
Our internal marketing team utilizes a number of low code no code tools for marketing automation and day to day tasks. Hubspot and Elementor are two great examples of such utensils.
No code in software delivery
Sometimes, low code no code helps us speed up the work on certain projects. Thanks to combining the usability of no-code tools with high-quality custom code, we are able to provide our clients with top-notch solutions within a short time.
For instance, for our pro bono project for Laboratorium Marzeń Foundation, we plan to use a pre-built CMS admin panel which allows API integration.
This way, we will be able to solely focus on the frontend and backend part of the app.
Will the no code movement replace programmers?
The short answer is: no. No matter how significant the low code no code movement becomes, there will always be a need for the integration of systems, the implementation of more specific and advanced solutions, or the creation of new algorithms. Needless to say, at the end of the day developers are needed to build the low code no code platforms in the first place.
However, many businesses will incorporate no code tools into their operations in order to save money and hire fewer developers. The low code no code movement is also a great opportunity for start up companies as it allows them to quickly build a working solution, especially at the MVP level, when it is important to reach the first customers with it.
Most of the time, with no code platforms, they can effortlessly introduce immediate changes to the solution, without the need to involve (or even hire) dedicated IT professionals. When it comes to established enterprises and corporations, as they have bigger budgets to allocate, they will continue to hire experienced developers with advanced coding skills. Especially in cases when extensive application functionality, data governance and deployment to specific architectures or environments are required.
Low code no code movement in 2022 – what will the future bring
Low code no code is growing rapidly. As it carries on solving real business problems, the movement will continue to gain traction, especially in the light of the shortage of developers.
According to Gartner analysts, the low code market is expected to surpass $13.8 billion by the end of 2021 and to continue to make gains until it reaches nearly $30 billion by 2025. Furthermore, Gartner forecasts that by 2024, low code application development will represent 65% of all application development activity, primarily for small and medium-sized companies. Another leading global market research company, Forrester, predicts that, by the end of 2021, 75% of all software agencies will adopt low code platforms.
Meanwhile, KPMG research indicates that the number of business executives who deemed low code no code development platforms as their main automation investment has almost tripled since the start of the pandemic in early 2020.
Interest of “low code no code development” over last 5 years. Source: Google Trends
A large part of the growing interest in this movement is also due to the fact that it removes the barriers that once existed by opening up the world of software creation to those who may be intimidated by learning how to code. Vlad Magdalin, the founder and CEO of Webflow, has recently said in an interview with TechRepublic: “The low code no code movement is democratizing the act of software creation the same way that YouTube democratized video creation.”
As a result, a new type of non-IT professionals is emerging. So-called citizen developers, as Gartner referred to them as early as in 2012, are employees who build application capabilities that can be consumed by themselves or others, using tools that aren’t restricted by IT or business. In a report titled “Future of Applications: Delivering the Composable Enterprise”, analysts at Gartner predicted that by 2023 there will be at least four times more citizen developers working at large enterprises than professional developers.
As McKinsey demonstrated in a recent report, organizations that empower citizen developers outperform those that do not on innovation measures. In light of this, the demand for nontechnical experts will only increase in the future.
Our expert’s opinion on the low code no code future
Dominik Zyskowski, Consulting Director at Espeo Software, provided us with his insight into the future of the low code no code movement. In the testimonial he shared especially for the sake of this article, he says:
“There is no question that no code will continue to gain popularity as the number of people realizing that they do not have to learn coding to develop tech solutions is on a rise.
It is mainly possible because more and more people are exposed to a wide variety of technologies from childhood, which makes it easier for them to internalize new digital solutions and navigate systems for building apps. Nowadays, even kids can learn how to develop games using tools such as Scratch.
Though the demand for custom software development will never diminish, more and more solutions will be able to be developed with low code no code tools.”
Providing good quality applications is crucial for any business. The idea of having unit and integration tests for important parts of code has existed in backend languages for a long time. When it came to the front end – it was not always considered as something really needed.
Front end part was simple, user interfaces were not complicated, applications were usable even with some errors in the UI. Nevertheless, with rapidly increasing numbers of SPA applications and pushing more and more functionalities to the front end side, having very complicated user interfaces, testing client side code started to be treated seriously.
Choosing types of tests you write should always be a project specific decision. In the following article I will go through all types of tests that you can create for front end applications and highlight the differences between them. After reading it, you should be able to answer the question “What tests should I write for my next project?”.
Types of front end tests
Image below presents the test hierarchy in the form of a pyramid. It also includes additional test types which are outside of it.
Unit tests
At the bottom of the pyramid you have unit tests. They usually test small parts of the functionality. It can be some business logic responsible for doing specific calculations. Units can also cover behaviours of a single component in SPA frameworks like React. The smaller the parts you are going to test the better. Unit tests should be the majority of all your tests, building the solid ground for your application tests coverage.
Sometimes people create tests for container components which consist of multiple smaller components. In such cases, you should no longer think about such tests as a unit as those tests start to be integration tests. Units work on mocked data, prepared for each test case. Unit tests focus on implementation details and should be done by developers who fully understand code which need to be tested.
Integration test
Another type of tests are integration tests which test interaction between different parts of the application. Usually you take a group of components working together and make sure the results of their interaction match your expectations. The border between unit and integration is very blurry. Similar to units, those tests work on mocked data. Integration tests focus less on implementation details. They usually run on simulated or headless browsers.
E2E tests
End to end tests test application as a whole. They run on applications opened in real browsers and try to simulate real user behaviours. Application should run against a test server with data as close to “production” as possible. It is not possible to cover all possible user behaviours inside tests. The common approach is to cover the most popular “user journeys”. End to end tests don’t care about implementation details, they can be created by a separate QA engineer or developer who is aware of how applications should behave without any knowledge of how things were implemented.
This is a great benefit as such tests can be conducted even by someone outside the team who receive a full set of feature acceptance criteria. E2E tests can be configured to run on desktop or mobile resolution making it possible to check if application responsiveness was implemented correctly.
Other tests
Unit, integration and e2e tests are three main parts of our test pyramid. However, there are also different ways of testing front end applications:
Visual Regression tests – the idea is to check how an application is rendering its content. Usually, when some feature or page is ready, you can make a visual snapshot of it (screenshot) and mark it as a pattern against which you will compare in future. Then, when the application is evolving, you can from time to time run a snapshot comparing tool to check if all application visual changes were expected. It’s a great way to monitor if some styling done in another component or module affects things which already exist and should not be changed. Visual regression tests can be attached to Storybook which is displaying our components in isolation to prevent frequent changing of pattern if content of a specific page is changing.
Performance tests – performance testing focuses on how fast an application is loading and how accessible it is for an user. There are different tools which can help you monitor application loading time and suggest possible improvements. Very often performance problems start to be visible when executing E2E tests takes a lot of time.
Accessibility tests – accessibility tests focus on checking if our application is created in a way which follows A, AA or AAA accessibility levels. There are multiple different tools which will check and suggest possible semantic or colouring improvements for your app.
Cross-browser testing – this kind of tests focus on checking if an application is working in a consistent way on different browsers and different platforms. This used to be mostly a boring QA job to test against different devices. Nowadays, you are able to set up your E2E to be executed on multiple browsers. In the real world this is something which is not done very often.
Manual testing – I am mentioning it since this type of test will almost always exist in any project. However, the more you cover conducting all the tests types mentioned above, the less manual work will be needed.
What tests should you write for your next project?
Choosing a testing approach for your next project is not an easy job. There are a lot of things that have to be considered. First of all, you should think of the type of project you are developing. Good communication with the client is needed to deeply understand their needs and choose the best “testing plan”.
POC or Prototype Application
If you are working on a simple Proof Of Concept (POC) or Prototype application, spending time on tests usually doesn’t make sense. In case of such projects time is crucial and as a result you will never have a 100% ready application. Often such prototype applications will be recreated later on from scratch or only parts of the prototype will be reused. Such prototype apps may change frequently as requirements will be changing over time.
Suggested tests: none
Application done once without updates
If you are working on an application till the version 1.0 and you know that such an application will never get any updates, you should start thinking about some small set of tests. For sure you should start from the ground and implement unit tests for crucial components and business logic. You can also think of some basic e2e tests covering the most popular paths in your application. As applications will be released just once, those tests should help you mainly during the development.
Suggested tests: units, basic e2e tests
Application with frequent new versions or Product Application
For an application which will be supported for a long time and often new versions of it will be released, you need to make sure that your application is of a perfect quality. You should have units covering most of the components and business logic. Quite a good set of integration tests. E2E test covering all standard user journeys.
Suggested tests: units, integration, E2E tests
Applications with specific requirements
Choosing between other test types: visual regression, performance, accessibility or cross-browser always should be decided based on specificity of a project and client requirements.
Cross browser tests
For most of the projects you will support multiple browsers including mobile ones. Running E2E against all sets of browsers may be very time consuming making your pipeline to run for hours. Probably the best approach is still just to run an e2e test for a single browser with combination with manual testing or just run on 2 most frequently used. I would not advise you to overload your pipelines.
Performance
If speed of working is crucial to not lose users, then you should invest in performance testing. Starting from the intermediate development phase making regular performance checks after each or few sprints. Thanks to this, you can make sure that the application is going in the right direction. Some performance problems discovered when the application is almost ready may lead you to huge amounts of work needed for refactoring.
Accessibility
Accessibility requirements should always come from the client. If a client expects AA or AAA level proper tools which will scan your html, the structure will help you understand what is missing to reach desired accessibility level.
Visual regression
Visual regression should be done when having a very stable UI. E2E tests will check if a feature is working but they will not check if it looks perfect. For pages without dynamic content, you can collect patterns and add visual checking to your pipeline. For most applications built from reusable components, the best is to gather patterns from Storybook with standalone components displayed and make sure that further code changes do not affect them. If crucial is to also have a stable UI for all possible resolutions. You can gather screenshots from mobile/tablet etc. versions and also compare them inside our pipeline.
Conclusion
The test coverage concepts above are just a reference. Final decision is always up to the client but we as developers should always educate the client of the best possible approach for a specific application. Having a product application used by a huge number of users done without any tests is an extremely unwise decision but unfortunately sometimes it happens. Mainly because of poor knowledge about consequences supported by very limited resources for the project.
Hope the lecture of this article extended your knowledge about types of tests for front end applications and gave you a brief idea of what tests should be created for your new project.
In the next article I will focus on choosing the best tools and test frameworks for the modern front end technology stack in 2022, understand when you should execute specific tests, and put some light on typical problems when developing different kinds of tests.
This article was written by our Senior JS/Front end Developer, Łukasz Błaszyński. Łukasz has over 9 years of professional experience in the field. You can check out his Github profile here.
For the last couple of years the BI solutions like Tableau and PowerBI started to be very desirable for the projects. It did not take much time when business started to ask for test automation of created reports. Since reports can be published to the server like Tableau Server, the obvious choice was to use Selenium. Immediately when creating automated tests we can encounter problems validating reports. We can verify that a report has been generated but we cannot say whether it contains data or not. In this little tutorial I will present how to create a one-step test to retrieve data from a report using Tableau JavaScript API.
Cucumber Test
Let’s start with a simple cucumber scenario. It contains two steps. First one sets up a web driver and navigates users to the public Tableau report. Second one validates the report. We will simply verify if a provided in the parameter report Storm Map Sheet contains value ALEX.
[dm_code_snippet background=”no” background-mobile=”no” slim=”no” bg-color=”#212725″ theme=”dark” language=”javascript” wrapped=”no” height=”400px” copy-text=”Get the Code!” copy-confirmed=”You have it!”]
@Test
Scenario: Report contains data
Given I navigate to “https://public.tableau.com/views/RegionalSampleWorkbook/Storms”
And I verify “Storm Map Sheet” report is generated with data “ALEX”
[/dm_code_snippet]
Test Steps
Next step is a standard definition of test steps. Since step 1 is pretty obvious we will concentrate on step 2.
[dm_code_snippet background=”no” background-mobile=”no” slim=”no” bg-color=”#212725″ theme=”dark” language=”javascript” wrapped=”no” height=”400px” copy-text=”Get the Code!” copy-confirmed=”You have it!”]
@Given(“I navigate to {string}”)
public void iNavigateToUrl(String url) {
urlAddress = url;
tableauPage.navigateToReport(url);
}
[/dm_code_snippet]
[dm_code_snippet background=”no” background-mobile=”no” slim=”no” bg-color=”#212725″ theme=”dark”
language=”javascript” wrapped=”no” height=”400px” copy-text=”Get the Code!” copy-confirmed=”You have it!”]
@And(“I verify {string} report is generated with data {string}”)
public void iVerifyReportIsGenerated(String reportName, String expectedData) {
tableauPage.updateJSScript(urlAddress, reportName);
tableauPage.verifyReportIsGenerated(expectedData);
}
[/dm_code_snippet]
We see two method calls. In the first one we will be updating the existing JS script with provided values reportName and url. In the second method we will be validating Tableau report data.
Methods Implementations
Update JS script method does following things:
take template.js and put it into string
update values of $url and $reportName with provided ones
write the result to script.js
[dm_code_snippet background=”no” background-mobile=”no” slim=”no” bg-color=”#212725″ theme=”dark”
language=”javascript” wrapped=”no” height=”400px” copy-text=”Get the Code!” copy-confirmed=”You have it!”]
public void updateJSScript(String url, String reportName) {
String data = “”;
data = Files.readString(Paths.get(“Path to template.js”));
data = data.replace(“$url”, “\””+url+”\””);
data = data.replace(“$reportName”, “\””+reportName+”\””);
Files.write(
Paths.get(“Path to script.js”),
data.getBytes(StandardCharsets.UTF_8),
StandardOpenOption.WRITE);
}
[/dm_code_snippet]
Having updated script.js we can now navigate to index.html. When opening the page, the data of Tableau report are retrieved from Tableau JavaScript API and printed to the browser console. Then the method reads those data and validates them comparing with expectedData.
[dm_code_snippet background=”no” background-mobile=”no” slim=”no” bg-color=”#212725″ theme=”dark”
language=”javascript” wrapped=”no” height=”400px” copy-text=”Get the Code!” copy-confirmed=”You have it!”]
public void verifyReportIsGenerated(String expectedData) {
driver.get(“file:\\\\”+”Path to index.html”)
LogEntries log = driver.manage().logs().get(LogType.BROWSER);
List logs = log.getAll();
for (LogEntry e : logs) {
if (data != null) {
if (e.toString().contains(“script.js”)) {
Assert.assertTrue(e.toString().contains(expectedData));
}
}
}
}
[/dm_code_snippet]
Setting Chrome Driver properties
Important thing is to pass appropriate options to ChromeDriver in order to print ALL logs to the console. Obviously we can specify which logs should be visible in the console. In our case it is safe to print all. We then filter logs and validate just what is useful for us.
Unfortunately, this works only for the Chrome browser.
[dm_code_snippet background=”no” background-mobile=”no” slim=”no” bg-color=”#212725″ theme=”dark”
language=”javascript” wrapped=”no” height=”400px” copy-text=”Get the Code!” copy-confirmed=”You have it!”]
public static WebDriver setupChromeDriver() {
ChromeOptions options = new ChromeOptions();
var logPrefs = new LoggingPreferences();
logPrefs.enable(LogType.BROWSER, Level.ALL);
options.setCapability(CapabilityType.LOGGING_PREFS, logPrefs);
options.setCapability(“goog:loggingPrefs”, logPrefs);
options.setCapability(CapabilityType.ACCEPT_INSECURE_CERTS, true);
driver = new ChromeDriver(options);
return driver;
}
[/dm_code_snippet]
template.js
Finally template.js. Script contains $reportName and $url parameters which are replaced by test scenario data. In the function initViz() we call getData() function which gets underlying data from Tableau JavaScript API.
[dm_code_snippet background=”no” background-mobile=”no” slim=”no” bg-color=”#212725″ theme=”dark”
language=”javascript” wrapped=”no” height=”400px” copy-text=”Get the Code!” copy-confirmed=”You have it!”]
var viz, sheet, table;
function initViz() {
var containerDiv = document.getElementById(“vizContainer”),
url = $url
viz = new tableau.Viz(containerDiv, url, “”);
setTimeout(getData, 4000)
}
function getData() {
sheet = viz.getWorkbook().getActiveSheet().getWorksheets().get($reportName);
options = {
maxRows: 1,
ignoreAliases: false,
ignoreSelection: true,
includeAllColumns: false
};
sheet.getUnderlyingDataAsync(options).then(function(t)) {
table = t;
console.log(JSON.stringify(table.getData()));
var tgt = document.getElementById(“dataTarget”);
tgt.innerHTML = “
Underlying Data:
” +
JSON.stringify(table.getData()) + “
“;
});
}
}
[/dm_code_snippet]
index.html
And last thing is to create a simple html file to load underlying data when opening it.
As promised, a one-step test has been presented. As usual it took me much more time to figure out how to retrieve data from a Tableau report than to implement a simple scenario. This is not a fully UI test but definitely better than just simple selenium verification whether a report exists or not. Hopefully a similar solution will be soon available in different BI tools.
Manage Cookie Consent
We use cookies to optimize our website and our service.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
We use technologies like cookies to store and/or access device information. We do this to improve browsing experience and to show personalized ads. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.