CrossBrowserTesting.com

A Design, Development, Testing Blog

  • Product Overview
  • Pricing
  • Back Home
  • Free Trial
  • Design
  • Development
  • Manual Testing
  • Test Automation
  • Visual Testing

Using Agenda to Build User-Created Tasks in Scheduling

November 27, 2018 By Alex McPeak Leave a Comment

task scheduling with agenda

task scheduling with agenda

At CrossBrowserTesting, we wanted to give our users the ability to schedule their suite runs and screenshot tests to run regularly.

An example user story for this feature would be: Every morning Natalie wants to be reminded to check the status of one of the websites she administers. These tests help her make sure her website looks correct and functions properly. While she drinks her coffee at 8AM, our service will run their tests automatically and notify Natalie once they’re done.

Rather than making our users create a cron job or set an alarm on their phone to remember to do it, we gave them a UI to set up their schedules quickly and conveniently. In this article, we will describe our usage of a node package called Agenda.

Choosing Agenda

We chose Agenda because it fits in our stack as a node module that utilizes MongoDB for storage. The Agenda documentation was very nice and helped us get up and running quickly, and we found there was a set of different options for a tool with the features we needed.

Agenda’s flexibility to have multiple workers, accepting cron format, limiting concurrency, and process frequency all made us feel confident in integrating it into our stack.

Some default behavior we felt it was missing was a reasonable default for failure behavior for jobs and being able to pause a job. Luckily these behaviors were still possible to implement.

A comparison of tools similar to Agenda.

Handling Downtime

We are using an API to do the work of a job, so in the case our service was temporarily down, we need to be prepared for our jobs to fail and act accordingly. To account for this, we automatically reinsert the job into Agenda to run a minute later.

We keep track of the number of times we’ve done this and give up after five tries. We also save the failure message to give to the user.

catch(err){
//Something went wrong Try again soon :)
// retry 10 seconds later
if(!job.attrs.data.failCount){
job.attrs.data.failCount= 1;
}
else{
job.attrs.data.failCount++;
}
job.attrs.data.failReason = err.response.data.message;
var slack_data;
if(job.attrs.data.failCount<5){
job.attrs.nextRunAt =
moment().add(60000,'milliseconds').toDate();
}
else{
//failed
delete job.attrs.failCount;
job.attrs.data.failed = true;
}
await done();
await job.save();
}

Agenda relies on MongoDB for its datastore. Our MongoDB handles a large amount of our data’s info requests and sometimes experiences outages. When this happens, our Agenda Instance is incapable of gracefully closing.

Agenda locks jobs that it is working on, and when Mongo goes down, it has no way of unlocking those jobs. So It’s important for on restart we find any jobs stuck in ‘Locked-Limbo’ and unlock them.

Because the execution time of our jobs is so short, it’s typically safe to assume the job was in the queue but not actually started. We use Forever and Monit to daemonize and monitor our Agenda Instance. We receive Slack notifications whenever Agenda goes down.

Closing Thoughts on Agenda

After our experience, we can say Crossbrowsertesting recommends Agenda.

At first, we were wary of using Agenda considering it’s seemingly dead status on GitHub concerned us. Ultimately, now that Agenda is a part of our stack and in production, we feel confident in our choice. Agenda is a handy and versatile tool for scheduling jobs.

Filed Under: Product Update Tagged With: agenda, developer, development, product update, scheduling

The Developer Community’s Response to Microsoft Acquiring GitHub

June 5, 2018 By Alex McPeak Leave a Comment

microsoft acquires github

microsoft acquires github
On Monday, Microsoft announced its acquisition of GitHub in a $7.5 billion deal.

Since GitHub’s platform serves over 28 million developers and hosts around 85 million projects in an effort to create a community of collaboration and learning, this news is near and dear to our hearts at SmartBear.

Where SmartBear serves a hefty 6.5 million software professional in over 22,000 companies, many of our users are familiar with GitHub and regularly use it as a code repository. As the heart of the open source community, freelance developers and tech giants alike (Amazon, Google, and Apple come to mind) use GitHub for projects small and large.

So why Microsoft’s interest in GitHub in the first place? Microsoft is the top contributor to GitHub with roughly 1,300 employees pushing code. After recently shutting down its own version of GitHub, CodePlex, Microsoft mentioned that they had already moved most of their projects to GitHub, noting “GitHub is the de facto place for open source sharing and most open source projects have migrated there.”

For this reason, the acquisition isn’t totally surprising, and to many speculators, seemed like the logical next-step with Monday confirming rumors.

Upon hearing of Microsoft’s acquisition, we’ve noticed mixed reactions. Looking quickly at the poll on SmartBear’s Twitter, you can see the vote is split.

How do you feel about #Microsoft acquiring #GitHub?

— SmartBear Software (@SmartBear) June 4, 2018

The majority of respondents at 38 percent take a neutral stance and don’t think much will change. Meanwhile, people are weighing in on each end of the spectrum with 34 percent foreseeing positive change and 28 percent feeling uncertain towards GitHub’s future.

Those that are faithful in Microsoft are hoping that it could provide the stability GitHub has been needing in recently turbulent times. Additionally, there is excitement around the ways that Microsoft will be able to elevate GitHub’s current capabilities by making it easier to develop in the Azure cloud, expanding the GitHub Marketplace, and integrating VS Code with GitHub support, for example.

Where does the skepticism come in? Some are afraid that GitHub could go the ways of Skype after Microsoft’s acquisition of it in 2011. After Microsoft made software updates to the popular video calling platform and refocused it for enterprise consumers and corporate markets, loyal Skype users began taking to the internet to complain, saying bugs in the UI had made Skype too difficult to use and it did not resemble the software they once loved.

Additionally, not all developers trust Microsoft to be the open source ally it claims to be. Some fear that keeping their projects on GitLab could take a turn for the worse if Microsoft were to use their powers for evil and dig into competitors’ private repositories or take advantage of data mining.

A percentage of users have taken on such a strong stance against the acquisition that they are already flocking to rivals such as GitLab, possibly influenced by the #movingtogitlab hashtag and discounted packages.

One thing’s for certain, Microsoft has done a lot for the open source community, which is something devs can get behind. Supporters of the acquisition point out that Microsoft isn’t the same company it was a few years ago since CEO Satya Nadella came on in 2014.

Pursuing open source technologies such as PowerShell and Visual Studio Code, Microsoft has made notable contributions to the open source community in recent years thanks to Nadella. Additionally, by making the move to support more open source ventures such as embracing Linux, Microsoft has separated itself from its anti-OSS reputation in order to offer products and services that work on a variety of platforms developers are using.

It’s apparent with the acquisition of GitHub that Microsoft hopes to continue making a name for themselves in this space, and the company has promised to keep GitHub independent and open.

This is something that we’re passionate about at SmartBear as we strive to support the open source community, and many of our tools are either open source or integrate with open source projects.

While Microsoft makes a valiant effort to play a critical role in the open source community, it seems that our best option is to get behind them until they give us a reason not to.

Let’s put this another way.

GitHub is Microsoft’s chance to really prove to you how much they value OSS and your code.

Flip side, if they screw this up, you all will definitely not forgive them for it.

HIGH STAKES BABY! FEARLESS.

— Kelly Sommers (@kellabyte) June 4, 2018

Filed Under: Development Tagged With: developer, github, Microsoft

How Every Team Member Can Leverage a Test Automation Tool

May 24, 2018 By Alex McPeak 2 Comments

test automation tool

test automation tool

With the introduction of test automation tools such as CrossBrowserTesting, it’s easier than ever for teams to meet the demands of Agile, CI/CD, Continuous Testing, and DevOps. However, while testing used to be a job strictly for QA, software teams are finding that this no longer applies to their development process. As organizations continue to shift left, the lines continue to blur between different roles, and testers aren’t the only ones testing anymore.

If your entire team is ready to take on more testing, here’s a few ways each member can best leverage a test automation tool.

Digital Marketers – Think that your marketers have no use for testing? Think again. Anyone on your team that cares about Search Engine Optimization (SEO) will likely be aware that mobile responsiveness is a factor when it comes to domain authority. In fact, Google has stated that responsive design is the recommended design pattern, which means that web applications that are optimized for mobile will actually show up higher in peoples’ search results. Your marketers may want to take advantage of a visual testing tool so that they can evaluate priority pages on different devices and screen sizes to determine whether or not they’re responsive. Ensuring mobile-friendliness will also benefit SEO by accelerating site speed, decreasing bounce rate, and boosting social sharing, making testing a marketer’s secret weapon.

Product Managers – Testing doesn’t have to (and shouldn’t) wait until the end of the SDLC. In fact, it can take place as soon as the planning stage, especially when shifting left. Product Managers can expertly use the data of past test results to influence the direction of the product, but they can also perform their own testing to make immediate improvements and determine what changes should be made in the application next. By focusing on the usability of the application, product managers can perform exploratory tests to better understand what forms could be more intuitive or determine if the site is optimized for accessibility, for example. Additionally, product managers might find value in testing newer features recently implemented by the development team that impact usability (homepage layout, checkout process, etc.) to make sure it fits into the buyer journey they way they intended.

Designers – If your designers have been manually testing your website to make sure it looks good across browsers and devices, that’s a good first step, but they shouldn’t stop there. Visual testing allows them to automatically capture screenshots of a URL on tens of browsers and compare them side-by-side. By picking a base browser, they can see where there are differences in each layout and decide which are acceptable and which need to be fixed. Whether an app is off by one pixel or a hundred, your designers can determine for themselves whether everything looks the way they want it to across configurations. It’s also important to make sure everything works in addition to looking exceptional, which is why Record & Replay helps test across the same browsers to make sure things like buttons, navigation, and link are all working as expected.

Developers – While we believe that every software development team should have it’s own dedicated QA team, that’s not to say that there are not certain times where developers should test their own code. It goes without saying that when a new feature is added, change is made, or bug is fixed the developer should ensure basic functionality of that new implementation after the code is adjusted by testing it. For longer test cases or more elaborate projects that restructure large areas of the application and require more extensive, end-to-end testing (such as you might see with a website rebrand), developers might want to also run one-off tests without taking up too much time. By leveraging prior programming knowledge to learn Selenium commands, developers can ensure functionality without spending hours on testing. Instead of manually executing a basic test case, they could write an automation script in a fraction of the time and still cover large areas of code to check whether it passes or fails.

Manual Testers – Manual testing will always be a crucial part of QA because it depends on the curiosity, observation, and skill of the individual to execute tests that will provide insight to the rest of the test. However, while exploratory tests can be the best part of the job, manual regression tests can be the bane of their existence. Despite the name of the role, manual testers no longer have to be confined to strictly manual testing. With test automation tools like Record & Replay, manual testers can automate the tedious, boring, and repetitive testing that they’ve come to dread without having to learn a programming language or getting up to speed with complex testing frameworks.

Automation Engineers – For the tester that’s mastered Selenium and has too many UI tests to count, how can they speed up testing to take it from days to hours? Parallel testing is the key to making your automation time even faster. By simultaneously testing in multiple browser configurations at once instead of one after another, parallel testing allows you to take your suite and divide the time spent running tests. Just by running a test in two browsers at once, you’re already cutting your automation time in half because you’d be testing them all at the same point in time. You can see where this would really pay off as you continue to add more tests, create longer suites, and run them on more browsers.

Conclusion

When everyone in the SDLC is moving fast to implement and deliver new features, testing is no longer a one-man job. In order for other team members to meet their deadlines, they must also be held accountable for some of their own testing.

While we can never replace the important work of our QA teams, there are tools that can help ensure that everyone plays a part in ensuring speed and quality from planning to deployment.

Filed Under: Test Automation Tagged With: developer, marketing, product manager, QA team, test automation, web designer

What’s the Best Programming Language to Learn First? It Depends

April 18, 2017 By Alex McPeak 7 Comments

Best programming language to learn first

Best programming language to learn first

Whether you’re looking to begin coding as a hobby, a new career, or just to enhance your current role, the first thing you’ll have to do is decide which programming language you want to start with.

There is no right answer, of course. Choosing a first language will depend on what kind of projects you want to work on, who you want to work for, or how easy you want it to be. Hopefully, this guide will help give you a better idea of which one you should pursue.

Python

Python is always recommended if you’re looking for an easy and even fun programming language to learn first. Rather than having to jump into strict syntax rules, Python reads like English and is simple to understand for someone who’s new to programming. This allows you to obtain a basic knowledge of coding practices without having to obsess over smaller details that are often important in other languages.

Python also is ideal for web development, graphic user interfaces (GUIs), and software development. In fact, it was used to build Instagram, YouTube, and Spotify, so it’s clearly in demand among employers in addition to having a faster onboarding.

Though it has it’s advantages, Python is often thought of as a slow language that requires more testing and is not as practical for developing mobile apps as other languages.

C#

While C is one of the more difficult languages to learn, it’s still an excellent first language pick up because almost all programming languages are implemented in it. This means that once you learn C, it’ll be simple to learn more languages like C++ and C#.

Because C is more “machine-level”, learning it is great for teaching you how a computer functions. Software Developer Joel Spolsky compares it to understanding basic anatomy before becoming a medical doctor, making it the best way to code efficiently.

In this way, C is an exceptional choice to become a master coder and a talented developer from the get-go if you’re willing to take on the challenge.

Java

Java is an object-oriented and feature-heavy programming language that’s in high demand. It’s been built under the premise of “Write once, run anywhere,” meaning that it can be written on any device and work cross-platform.

This makes it one of the most desired (yes, we mean high-paid) language skills. So, if you’re looking to learn a language that’s going to get you a great career, this might be the one, especially since top employers for Java programmers including Ebay, Amazon, and IBM.

Additionally, Java is often used for Android and iOS app development, as it’s the basis of the Android operating system, which makes it one of the best choices if you want to build mobile apps.

While it may not be as easy to pick up as Python, Java is a high-level language, and so it’s still relatively beginner-friendly. However, it has a slow startup and will take beginners much longer to deploy their first project.

JavaScript

JavaScript is another incredibly popular language. Many websites that you use every day rely on JavaScript including Twitter, Gmail, Spotify, Facebook, and Instagram according to General Assembly.

Additionally, it’s a must-have when adding interactivity to websites because it communicates with HTML and CSS. This makes it essential for front-end development and consumer-facing websites while becoming increasingly important in back-end development and growing in demand all the time. Because of its popularity, JavaScript is also the leading the charge in test automation frameworks, being the backbone of frameworks like Protractor and Nightwatch.JS.

There’s nothing to install with JavaScript since it’s already built into browsers, so it’s the easiest language to get started with in terms of set-up. The con here is that this means it’s interpreted differently across browsers (you’ll need to do some extra cross-browser testing) and may have deficiencies in responsive design compared to server-side scripts.

Again, while it’s not the most difficult to learn, it certainly isn’t as easy as Python. If Javascript does seem difficult at first, try out this Javascript tutorial that’s so easy a cat could do it.

Ruby

Ruby is similar to Python in that it’s one of the easiest languages for people with no prior programming experience to read. You don’t need to know a ton of commands or programming vocabulary to learn it, and it has a multitude of libraries and tools that come in handy.

A big reason people like Ruby is because of the awesome full-stack framework, Ruby on Rails, which is becoming increasingly popular among startups and enterprise solutions. Airbnb, Groupon, Hulu, and Soundcloud are just a few of the websites that were built with Ruby on Rails, and Ruby has quite the active developer community today.

The reason it’s so popular for small businesses, however, is often one of the many criticisms against it. Ruby can have the challenge of scalability across a large system and may have a hard time with performance on larger websites. Additionally, while Ruby is certainly easy to learn, you’ll find most of the opportunities come from learning Ruby on Rails, which may slow down your learning curve if you were just expecting to take the easy way out to create a website.

So, What’s the Best Programming Language to Learn?

  • If you’re looking for something easy: Python
  • If you want a solid foundation to make you a master developer: C
  • If you’re looking for a job or want to make mobile apps: Java
  • If you want to try front-end development: Javascript
  • If you’re programming for your startup’s website: Ruby

While there may be a strategy to choosing, Roger Collier emphasizes that programming is hard no matter what you pick (even with Python). It’ll be frustrating to get started, and moreover, become really good at it. However, he also suggests that this affinity for taking on the challenge to learn a skill that others may not have the patience for is what inherently makes coders so unique.

In his own words, Collier — a Javascript enthusiast — asserts  “Learning programming is hard, and that’s why I like it.”

Especially for testers, as the QA industry begins to increasingly require skills in test automation, programming knowledge becomes an invaluable asset. In “Coding is key to a test automation career: Are you prepared?” T.J. Maher advances that learning to code is the number one way to break into test automation. Then, even after you think you understand it, you need to continue practicing all the time.

“The most important thing is not to stop practicing to code once you’re hired as a test automation engineer,” said Maher. “Learning is a never-ending journey.”

Additionally, no matter what language you choose, you’d be well advised not to stop after your first language — the best programmers have a combination under their belt. After you learn one, the rest will likely be easier to pick up.

To get started on with test automation in one of these languages, check out Selenium testing guides or check out our eBook on moving from manual to automated testing.

And, if you still can’t decide, here’s a really cool infographic that should make things easier for you.

best programming language to learn

Image Credit

Filed Under: Development Tagged With: coding, developer, programming language

Try CrossBrowserTesting

Everything you need for testing on the web. Browsers & Devices included.


  • Grid In The Cloud
  • Simple CI Integrations
  • Native Debugging Tools
  • Real iOS and Android
  • 2050+ Browser/OS Combinations
  • Intuitive REST API

Start Testing Today

Want Testing Tips?

Want the latest tips & strategies from industry experts right to your inbox? Sign up below.
 

Join Over 600,000 Testers & Developers And Start Testing Today

Learn more Free Trial

Features

  • Live Testing
  • Selenium Automation
  • Automated Screenshots
  • Screenshot Comparison
  • Local Testing
  • Real Devices

Solutions

  • Automated Testing
  • Visual Testing
  • Manual Testing
  • Enterprise
  • Internet Explorer

Resources

  • Browsers & Devices
  • Blog
  • Webinars
  • Integrations
  • ROI Calculator

Company

  • About Us
  • Careers
  • Plans
  • Terms of use
  • Security

Support

  • Help Center
  • API Docs
  • Schedule A Demo
  • Contact Us
  • Write For Us