The document discusses web automation using Selenium, highlighting its importance in QA automation due to resource limitations and the need for higher testing confidence and coverage. It outlines various aspects of Selenium, including its ability to automate browsers, support for multiple programming languages, and features for writing tests. The document also touches on testing frameworks and the advantages of using free vs. paid tools, as well as practical examples of organizing and executing tests.
Web Automation usingSelenium
Autor: Ana Sârbescu
Software Testing Community
in Macedonia
November 2015
2.
Summary:
● Why QAautomation?
● All kind of tools for automation!
● Automation Framework?
● Using Selenium for web automated testing
● …with examples.
3.
Why should weautomate?
● Lack of resources and too much to test.
● Higher level of confidence, higher coverage.
● Free your time for creative testing!
● Agile approach to testing
– Regression gets little time during a Sprint
– Continuous increase in what needs to be tested
4.
What tool wecan use?
● Payed vs Freeware
– You won’t get the money
for it! ☺
– But it would be much
easier if you would.
– Free tools are not so
easy to use.
– Though they might be
more powerful.
● Recording vs Scripting
– For recording you need
no programming skills.
– But the options are very
rigid.
– With programming skills
you can make the world
go round…automatically.
Oh way…it already does..
➢ Sometimes you don’t have free tools to do what you need (ex.
Multiple platforms/Compatibility testing)
5.
Programming Skills?
● Basic!^_^
● Depends on the tool
● Depends on the framework type (recording or
scripting)
● Depending on your application type
● Depending on your testing goal (unit testing,
functionality testing, security testing etc)
6.
The. FRAMEWORK. !
●What does an automation framework mean?
– Specific language
– Continuous Integration
– Available Test Data
– BDD?
● Who needs to do it? Well…who can. ☺
● Why is it needed? Because TIME!
7.
Selenium Webdriver.
● ForWEB. “Selenium automates browsers. ”
● It interrogates and manipulates the HTML.
● Contains domain-specific language (Selenese).
● Works with all browsers and platforms.
● Can be run remotely on different devices, at the
same time.
● It integrates with so many tools.
● Works with most languages: Java, C#, Groovy, Perl,
PHP, Python and Ruby
8.
How we writetests in Selenium?
● Using its main actions:
– Initiate the browser:
● WebDriver myBrowser = new FirefoxWebdriver;
– Navigate to URL:
● Java: myBrowser.get("http://www.google.com");
● C#: myBrowser.Url = "http://www.google.com";
– Find elements:
● WebElement myElement = browser.findElement(By.id
("coolestWidgetEvah"));
● List<WebElement> myList = browser.findElements(By.
className(“differentOptions"));
– Verify condition
● Ifs, Verify and Assertions.
11.
Finding elements by
●ID:
– By.id(“cheese”);
● Class:
– By.class(“cheese”);
● Name:
– By.name(“cheese”);
● Tag Name:
– By.tagName(“cheese”);
● LinkText/partial link text:
– By.linkText(“cheese”);
● CSS:
– By.cssSelector(“#food span.dairy.aged”);
● XPath:
– By.xpath(“//input”);
Organizing your tests
●Junit, TestNG, Testem, Telerik, Nightwatch,
NodeJS, SoapUI etc
● Test suits, test grouping, tagging
● Configuration for different platforms