
With the conclusion of our very first Selenium Academy class we wanted to ensure we armed you with the answers to some of the most common questions that came up during our live QA session!
In our Selenium 101 class we started at the very beginning by explaining what Selenium is, why you will want to use Selenium for your UI testing and especially why you will want to use Selenium with CrossBrowserTesting. But let’s take a look at some of the most common questions that came up during last week’s webinar.
What is the difference between a Selenium grid and CrossBrowserTesting?
While you can make your own Selenium grid with a costly device lab or VMs, many have found moving their Selenium grid to a third-party cloud like CrossBrowserTesting is faster and more productive, allowing more tests to run on more machines in less time. With over 2050 browsers to choose from, the possibilities of parallel test execution with CrossBrowserTesting are almost limitless. Our browser, device, and operating system selection includes all the latest configurations as well as legacy browsers so you can test what your users are on without worrying about any of the associated costs or upkeep. There are certain real costs of building an in-house environment as well as countless other secondary costs of not going with a cloud provider, like CrossBrowserTesting.
Selenium is open source right, why would we need to buy CrossBrowserTesting?
We can give you 8 good reasons!
- We make it easier to get started.
- Just install Selenium bindings for your programming language of choice and be done!
- Eliminate the work of managing and maintaining Selenium Servers, WebDrivers, and Browsers
- Screenshots, videos, and even network data can be captured during a Selenium test and shared with anyone
- Higher concurrency means faster execution
- Run dozens of tests at once without having to run dozens of RAM-hungry browsers
- Spend less time waiting and more time doing what matters
- Instant access to thousands of browsers and devices, including mobiles
What languages are supported with Selenium?
C#, Java, JavaScript, PHP, Python and Ruby
Which language is the easiest to get started with?
When talking with users about what language is easiest to get started with, we always recommend Python. The reason we recommend it for beginners is because it reads like English and tends to be easier for users to understand when getting started. Take a look at our blog on the Best Programming Language to Learn First.
What’s the best way to set up tests to run within a build pipeline using Jenkins?
There are only two things you need to be able to run your selenium tests from a Jenkins pipeline. You need a shell script or batch file that Jenkins can call to start your test, and Jenkins needs access to any libraries or modules that you use during the test – including the Selenium language bindings. If you are using Python, you can use VirtualEnv to create a virtual environment for Python with Selenium already installed. If you are using Java, make sure to include Selenium in your pom.xml file and run mvn build.
Does Selenium have the ability to open two webpages at the same time?
Yes, Selenium can be used to easily manage multiple pages at the same time. You can use the built-in command “switch_to_window()” documented here: Learn More Here
Is it recommended to use find element by xpath always?
Quite the opposite. Using Xpath to find elements, especially absolute Xpaths, tends to lead to very brittle tests. Any small change in the hierarchy around the element you are locating could cause the wrong element to be selected. Those bugs in your Script can sometimes be hard to debug. You should save yourself the trouble and use element IDs as much as possible
So, find_element_by_id is the best function?
Yes, it’s the most resilient to change and the easiest to use. If you can, add human-understandable IDs to any elements of your page that you want to automate.
For AngularJS based applications, do you have any specific built in functionality?
CrossBrowserTesting does not provide specific functionality to test websites built with AngularJS, but CrossBrowserTesting does work with Protractor – a Selenium-based framework created by Google for testing AngularJS. We have a short guide on getting started here: Help Doc for Protractor
How well does protractor work with just regular Angular?
It works great! That’s what it’s made for. If you run into any problems, feel free to reach out to our support team and they’ll help get you up and running.
Want to register for our 201 class on August 27th? Register now!
Leave a Reply