Monday, December 31, 2018

Review: Exploratory vs Manual Testing

@fwmoyer states the difference between Exploratory Testing and Manual Testing is a mindset. And I agree with him. Here's a quick article on explaining why.

https://www.softwaretestinghelp.com/exploratory-testing-vs-scripted-testing/

Overall, context is always valuable when driving something purposeful. In order to reach quality results (i.e. results that matter and add value), context is required especially to help to create productive roadmaps whether designing, developing, and/or testing.

Review: Jamboard (by Google)

I don't know why I'm just now hearing and learning about Google's Jamboard, but I am glad to hear about it now than later.

One of the benefits of this product is its mobility. You can do a lot with this tool like with a smartboard, but you can move it around. Here's an example of why being "mobile" is superb. What if I'm innovating well at work but for some reason I get laid off? Well, I can take my Jamboard and ideas with me. That's it. Well, and continue my career. :D

One of the biggest disadvantages in growing ones career is having to start over. In today's world where there are many smart people making many smart moves, a person needs to have smart tools that move with them as well. So, this is my pitch for this tool by Google: Jamboard.

Check it out.
https://www.youtube.com/watch?v=gXwV5SlKLAE (intro to Jamboard)
https://www.youtube.com/watch?v=hVZPh8Zz8lw (intro to Jamboard in 'Google for Eduction')

Sunday, December 30, 2018

Review: Traditional Developer vs Cloud Developer

Another interesting article.
https://blog.bluesoftglobal.com/cloud-developer/

I need to do more research on the argument made in this article about the need to become a Cloud Developer. There will just be too much technology to learn if we keep thinking that a techie needs to learn stack development, deployment, tech support, translation of business domain knowledge into technical feasibility, and more.

Teams will continue to grow and not with an all-in-one talented techie. Developers will continue to need to specialize, in my opinion. But, if the cloud handles all the deployment and support issues, then maybe a developer can just focus on - developing?

Friday, December 28, 2018

Review: 10 Critical Tips to Learn Programming Faster

Today's article, I'm focusing on something practical and essential for all people working with technology: 10 Critical Tips to Learn Programming Faster

I like what the author does here and her explanation is straight to the point. But, if you want to know some of the practical challenges accompanying each tip, then here's what I'll add (based on my experience).

1. Start With the Basics and Spend More Time There


  • This is fundamental to learning any skill. So, don't learn just because you feel like it or it sounds cool, but learn with purpose; learn with the intent to master the skill.
  • This takes time, lots of time! So, start early as possible.
  • These basics can become boring if you're learning by yourself (like playing any sport by yourself). So, learn with friends and enjoy the course(s).

2. Coding by Hand is Highly Recommended


  • This is a great tip for interviewing, but is practically useless. With so many programming languages to choose from and so many companies using multiple languages to suit their product development, practicing in one language might not be helpful with understanding and using another language. However, practice coding in a way to understand the programming language. Pick a few languages like industry standards such as Java, JavaScript, and SQL. Pick languages that a full stack developer would require.
  • Know how to write pseudocode. With the computing industry changing quicker than ever before, it's important to switch between programming languages and still carry the function definitions and application structure over. 
  • In addition, other people should be able to read and easily understand your code.

3. Fiddle Around With the Codes


  • Don't just fiddle, but start exercising your creativity and figure out how to update the code. This is also called "refactoring". Learning to made code updates is a lifelong skill since most programmers must work on teams which means eventually you'll need to update someone's code - including your own.

4. Reach Out to Others for Guidance


  • Make mentors that are tech gurus. It's difficult to find tech gurus, but not if you get involved in open source project like in Apache Software Foundation.
  • Take advantage of online mentors (that you may never meet).
  • Take advantage of community forums online like Reddit and StackOverflow.

5. Take Breaks to Get Refreshed


  • This is not a critical programming tip, but a good tip for every hard worker out there.
  • This is much easier said if you don't have any social responsibilities.
  • I guess the gist here is to do what you need to do to work smarter and healthier.

6. Use Online Resources


  • I thought I would see some reference here to StackOverflow or useful sites where programmers learn to "debug" and "troubleshoot", but I didn't. Thus, make sure you bookmark sites that help you not only learn to code, but learn to decode/encode (so to speak). :)
  • There are hundreds of online tutorials. So, go through some sites, pick your top few, and be sure to add YouTube to that list. There are great channels on YouTube offering free tutorials and resources. Also, tech giants offering tutorials use YouTube. Note: I haven't seen many tutorials on Vimeo (or any other online video library site).

7. Read Relevant Material


  • What's funny to me about this tip is that the statement with  the "majority of real-life situations...the client's team will possess complete knowledge of their business". From my experience, this is not really true. As a software developer, or aspiring software developer, you'll learn that the business experts eventually become outdated (due to lack of vision and improving current processes rather than focusing on disrupting processes for greater ROI) or they become dreamers (and provide unrealistic visions and predictions).
  • Before becoming an expert in a business domain, you'll need to ask yourself about the direction that you want to take your work. Do you want to start your own business one day or invent something? Or, do you want to become a tech guru within the company or industry you're in? After you choose the question to answer (and you can't choose both), then you will learn to understand how to code in ways that will take you to your career destination.

8. Learn From the Bugs


  • This is another tip which I find interesting to lack the advice on specifically leveraging online community forums. One particulary online forum that is picking up attention is GitHub. So much code is not being stored in GitHub that one can pick up lots of knowledge on how to create by leverage.
  • Again, leverage sites like StackOverflow for debugging.
  • Understand the limit of tools used for debugging as well.
  • Better yet, learn to write tests (e.g. unit tests, end-to-end tests) before you write your program and then you'll pick up a better habit than debugging.

9. Never Get Tired of Practicing


  • Practice with other like-minded coders.
  • Practice to innovate, not just to improve - because you'll never reach perfection.
  • Problems are neverending, and you'll need to discover how to become quicker at finding or creating solutions. This takes practice, too, and can be practiced outside of coding like with puzzles, understanding economic impact on local developments, studying psychology and quizzing behaviors, and learning different parts of society by volunteering and traveling.

10. Keep Your Cool


  • I actually thought this tip would address the politics in a workplace. Every developer not only needs to know how to "play with others", know how to code according to customer satisfaction, know businees needs and where the development team fits in, but also how to challenge bad ideas without offending people as well as add value to an organization's mission.
  • Never think your work life is about your life; it's about work. Never bring "work" to your life. Bring "life" to your work.


Good luck, newbie!

Thursday, December 27, 2018

Gartners Top 10 Tech Trends 2019

Here's a good article to read for any person who works.
https://sdtimes.com/softwaredev/gartners-top-10-technology-trends-for-2019/

Reference on Test Tools of 2018

As we come to close the year 2018, here are a few articles on the test tools shaping the industry (tech and all others) and that will continue to add value into 2019.

Notice that one of the rising stars is TestIM.io. Keep an eye on this company, its tool(s), and its service(s).

Software Testing Help - Top 20 automation testing tools (Dec 2018)


Actually, this is the only article I found online that was recent (aka relevant) and didn't seem to have a bias toward any tools (i.e. promoting commercial over open source, etc).

More importantly, let's keep an eye on the AI automated tools. Just like robots are replacing people in factories, AI will replace the mundane programming jobs. Therefore, humans will need to learn how to establish more roles in the R&D industry (which ironically was almost wiped out by corporations in the early 2000s due to foolish business cuts).

Monday, December 17, 2018

Examining Value of Tests

Some valuable points made in this article. One thing I see missing is the accountability for those who collect user requirements and delivers requirements to the Development Team for implementation. Sometimes, the issue isn't as much as the development as it is the requirement(s) and product design. These metrics should also be collected (as defects in requirements) instead of counted towards bugs or issues in development.

https://blog.testproject.io/2018/12/04/how-do-i-know-my-tests-add-value/

Thursday, December 13, 2018

Intro to a Coding Mindset

From the article:
"We want to propose that beginner coders could start with an attractive and engaging activity, but should also explicitly develop what could be called "the coding mindset."
This mindset represents a gradual development of  programming knowledge and strategies, but also includes analyzing systems, solving problems, persisting in front of errors, being resourceful and collaborating.
To teach the coding mindset, educators need to include more explicit foundational  concepts and competencies, such as creating algorithms to solve problems, debugging existing programs, and designing systems to accomplish new tasks or gather data.
Learning to code should not be intimidating. But it should fulfil promises, not simply hype mythic dreams."
https://phys.org/news/2018-12-code-movement.html

Tuesday, December 4, 2018

JayWay - JsonPath

Today I read a couple articles from TestProject and found this new library quite interesting (when a Maven project uses this library).
https://github.com/json-path/JsonPath

This library helps to format the structure of a JSON file/response.

Wednesday, November 28, 2018

Which Java - since Java's future is at stake?

Many are still talking about the importance of programming in Java. Since there are many apps and systems still running on Java, the need for Java support is still in demand. Or is it?

With Oracle putting the value of Java on the line (and risking its extinction like Solaris), perhaps I need to consider the other options. Especially with Google and community creating Kotlin (as a solution to replace Java). And especially with Amazon now also addressing this concern with its own solution called Corretto (and OpenJDK).

https://aws.amazon.com/blogs/opensource/amazon-corretto-no-cost-distribution-openjdk-long-term-support/

https://kotlinlang.org/docs/reference/comparison-to-java.html

The above link is a nice short comparison of why to use Kotlin over Java. It seems we, the community of developers, always have to wait for corporate to finally release a version which makes application development easier and product performance better. So, instead of waiting for Java <next version>, I think I'm going to try out one of the solutions in this blog.

Now, if I can only get some time to play with these languages. ;-)

Thursday, November 8, 2018

Journey into SET: Creating Test Framework in Selenium

So, I'm still on my journey back into becoming a Software Test Engineer (expert) and geesh, there's a lot to catch up on.

Today, I'm looking into creating a Test Framework with Selenium.

I googled on "selenium creating test framework" to see results and learn.

Why?
First, let's answer why I'm researching this topic. I am able to create test scripts using Selenium and my test are passing. However, as I'm creating a test suite and adding more tests, I find myself using the same code for multiple @Test. I'd like to reduce the code, use wrappers around Selenium's code, and condense my @Test to be specific on focusing on the test case. This also helps with test script maintenance. For instance, if I need all of my test scripts to navigate to their corresponding page (add form -> New Form, edit form -> Form, etc). Then, I realize I need the User to click OK to a dialog just implemented before displaying any form. I don't want to have to check this code for each test script in each @Test.

YouTube(s) I watched.
https://www.youtube.com/watch?v=DO8KVe00kcU

Article(s) I read.
https://simpleprogrammer.com/creating-automated-testing-framework-selenium/
Not very useful, unless going to author's course.
https://www.testingexcellence.com/develop-test-automation-framework-scratch/
I like the breakdown on this author's GitHub and see it's practical use. So, I decided to implement this same framework.

Pattern Insights
Since I'm using the PageObject pattern, this was very helpful to know.
https://github.com/SeleniumHQ/selenium/wiki/PageFactory



Monday, November 5, 2018

Software Testing article on 5 ways AI will change software testing

Article for today's reading...
https://techbeacon.com/5-ways-ai-will-change-software-testing

And here's an outstanding source of blogs related...
http://blog.testim.io/

It's important to try to keep up and not get discouraged at the pace of technology. :)

Jupyter Notebooks - what is it?

I stumbled upon this article and became very curious as to what a Jupyter notebook is.


Main website



Online Tutorials

Seems pretty cool for people interested in Data Science and crunching data especially using Python (or iPython). So, I decided to watch some YouTube videos to learn a little more.



Friday, November 2, 2018

Selenium Firefox - use common functions like getButton(buttonText)

Selenium Experts recommend that those who use the tool and implement it to test their applications (like me) should create wrappers specific to their application for the general code snippets frequently used. This is a long way of saying that we need to create common functions used by many Test methods.

For example, I need a common function that clicks a button given the button text. I don't want to have to keep writing this long code snippet:

(new WebDriverWait(driver, waitSeconds)).until(ExpectedConditions.presenceOfElementLocated(By.cssSelector(CssFormButtonBegin+buttonText+CssFormButtonEnd))).click();

Instead, I would like to use a common function like:

public void clickButton(String buttonText) {
  getButton(String buttonText);
}

public void getButton(String buttonText) {
// code that gets the WebElement of button type in CssSelector
// cssDoesNotWork = "button:contains('buttonText')"
// cssWorks = "form.className button#buttonId"
// or
// cssButtons = "form.className button"; // and loop through button list to find exact button by buttonText
}

Note that I use the CssSelector instead of the XPath to get the button element.

Useful Reference


Tuesday, October 30, 2018

Elasticsearch: Starting Over

I haven't worked with Elasticsearch in a couple of years. I remember using this on a project that I was on a few years back. But, now I'm on another project that uses this tool. So I need to re-learn and learn all the new things with Elasticsearch. But, this time, I'm documenting my learning so I can easily remember (if I forget this time around).

Website

https://www.elastic.co/


Selenium Fireforx - Test with clearing browser Cookies

Today, I need to add a specific test that only works when the Cookie is cleared from the browser. This was much simpler than expected. Why reinvent the wheel?

See details @ https://stackoverflow.com/questions/35403614/clear-browser-cookies-with-selenium-webdriver-java-bindings

Friday, October 26, 2018

Selenium Testing - My References & Bookmarks

Quickly Learning to be a Software Engineer in Test (SET)

In short, because I am learning so much and coding/testing so fast, I can't remember everything and I need to remember specific things fast and with order. So, this is my page to help me remember these important things for being a Software Engineer in Test (SET) or in simpler titles known as Test Engineer.

Online References

Selenium - FindElement(By <CSS Selectors>)



Useful Background Information


Online Tools

Load Testing Tools

Online Blogs

Thursday, October 25, 2018

Journey into SET: Part 3 - Follow Test Engineers

In this part of the journey, it's important to learn from other Testers (or SETs or Test Engineers). Yes, it's important to learn from Developers as well, but sometimes we forget the benefit of learning from other Testers. After all, we discover different things yet having the same overall mission: test the crap out of software! Well, not for any old reason, but with the goal of producing a quality product useful to our users and ourselves.

Anyhow, here are some Testers in the industry that I'm following.

Test Engineers


Test Tools

Debugging Errors - Trailing Whitespace in Properties file

Problem

Well, I know this seems minor, but when you're using Properties file to maintain a list of usernames/passwords for a Test Script that tests logging in as each user (because a specific user role is associated to these demo users), then this is a good way to maintain testing of the application's login.

So, long story short, one of users would crash the browser by hanging up the login page when attempting to login.

Solution

Long story short, I had one whitespace char trailing the username. So instead of the username being "user1", it was "user1 ". This whitespace char was not caught and handled well in the application which is now fixed, but this took a lot of time to debug. Unnecessarily.

Be sure that your Properties file has the property value as expected. Use a text editor displaying all characters in file, if need be.

Cheerios!

Wednesday, October 24, 2018

Killing Application Processes in Linux CentOS

I can't believe I have to write a post about this, but my Selenium test is hanging in the Firefox browser. I don't have time to figure out if it's my Eclipse IDE causing the Java Runtime issue or my Maven (with I doubt although this is how I launch the test to run) or Selenium driver that I'm using in Maven.

But, I got tired of searching online for the same commands because I can't remember all these Linux commands. I just don't work in Linux Terminal enough to remember all this in addition to what I'm actually coding.

Here's the article I reference (and avoid rebooting my machine):
https://www.makeuseof.com/tag/6-different-ways-to-end-unresponsive-programs-in-linux/

Here's the command I typically use:
$ ps aux | grep firefox
$ kill <processID>

Go process hangups! (Really though, why are we still having these silly issues in 2018?)

Tuesday, October 23, 2018

Selenium Firefox - Test dynamic webelement with waits

Problem

The problem I am having today is that my test that was working is now having issues related to browser performance. I am testing for an element to display in two tabs. The first tab opens and the element is captured. Next, the second tab opens to the same exact page, but Selenium can't find the element to capture before closing the browser.

I thought my implicit wait on the driver would suffice. It seemed to yesterday anyhow. So, now I am researching "waits".
https://www.seleniumhq.org/docs/04_webdriver_advanced.jsp

I didn't seen enough information on the main website for Java. So, I googled online for more information. Perhaps someone else has a cleaner solution? During my search, I noticed that there are two explicit waits: WebDriverWait and FluentWait. But, what is the difference?

FluentWait vs WebDriverWait

https://www.softwaretestingmaterial.com/webdriverwait-selenium-webdriver
https://www.softwaretestingmaterial.com/selenium-fluentwait/
https://stackoverflow.com/questions/40753321/fluent-wait-vs-webdriver-wait
Essentially, the difference is FluentWait offers more handling of exceptions in case the Wait doesn't find the element, etc. This is my understanding so far. Thus, I'll continue with WebDriverWait which auto ignores exceptions (like NoSuchElementException).

This is all good to know, but useless without knowing the impact of the class ExpectedConditions. This class "ExpectedConditions" has some key methods that we need to know when looking for a specific element or element attribute or element value.
https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/support/ui/ExpectedConditions.html
Well, there are a lot. Unfortunately, there aren't examples for each of these methods giving a descent explanation between the methods that appear similar.

Moving forward, this is an interesting, old article (posted in 2014). The author is first looking for the element and then looking for the text inside the element. Is this really necessary instead of simply looking for the text inside the element? Isn't there a wait on the element being completely rendered with text already? I don't know, but this would be to discover and understand.
http://www.software-testing-tutorials-automation.com/2014/01/webdriver-wait-for-text-to-be-present.html

Solution

Before digging into the details to understand, I discovered that this works. Here's my code which resolved my issue. Notice, this is a common method used by multiple tests.

public static Boolean isAgreementDisplayed(Webdriver driver, Integer waitSeconds) {

    WebDriverWait wait = new WebDriverWait(drive, waitSeconds);
    wait.until(ExpectedConditions.presenceOfElementLocated(By.className("modal-title")));

    boolean modalTitleExists = wait.until(
            ExpectedConditions.textToBePresentInElementLocated(By.className("modal-title"), "User Agreement"));

    return modalTitleExists;
}

Now, if I remove the first "wait" call, will my code still work? Surprisingly, or maybe not surprisingly, it does work. So, now my code looks like this (although I know I can shorten it more) and my test waits for my dynamic webelement to display and check its text before completing assertion.

public static Boolean isAgreementDisplayed(Webdriver driver, Integer waitSeconds) {

    WebDriverWait wait = new WebDriverWait(drive, waitSeconds);
    boolean modalTitleExists = wait.until(
            ExpectedConditions.textToBePresentInElementLocated(By.className("modal-title"), "User Agreement"));

    return modalTitleExists;
}

Cheers!



Monday, October 22, 2018

Selenium Firefox - Test timeout error after waiting for timeout page

In this test, I want to verify the Timeout Error Page displays after a User has logged in successfully, but has not used the Application after 15 minutes.

Remember, my timeout is in units of seconds. So, adjusting my browser timeout to 15 * 60 seconds plus 30 more seconds to ensure my browser doesn't throw a timeout error before my application timeout. In case this calculation moved too fast because you haven't gotten your coffee yet, I need to wait for 15 minutes, these 15 minutes each have 60 seconds (i.e. 1 minute = 60 seconds, and I must test in seconds according to my function of units), and then I need to wait a few more seconds for my test script to capture the timeout text from the page display before my test browser times out (i.e. plus 30 seconds).

Here's my code.

@Test
public void testLoginTimeoutError() {

    WebDriver firefoxDriver = new FirefoxDriver( new FirefoxProfile() );
    firefoxDriver.manage().timeouts().implicitlyWait(60*15+30, TimeUnit.SECONDS);

    Application.login(firefoxDriver, url, username, password);

    WebElement myTimeOutElement = (new WebDriverWait(firefoxDriver, 60*15+5))
        .until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("blockquote h2")));

    String timeOutText = myTimeOutElement.getText();

    Assert.assertTrue("Error: The timeout error did not display as expected.",
                                   timeOutText.equalsIgnoreCase("Your session has timed out"));
}

References
https://www.seleniumhq.org/docs/04_webdriver_advanced.jsp

Friday, October 19, 2018

Selenium Firefox (v2) - Test an Invalid User in Auth dialog on Application

I am trying to test how my web application handles an invalid user attempting to log in.

My Spring Security Application displays a Basic Authentication dialog (launched from the server side) before allowing the User to continue access into the web application (and render on client side). This dialog has only username and password fields.

I can't code lines that would enter the username and password into this authentication dialog. Thus, I followed a similar method like the solution given here:
http://www.tothenew.com/blog/easy-approach-to-handle-authentication-window-in-selenium-webdriver/

With a valid username and password, this code works and doesn't break my tests nor stops my test suite. However, with a an invalid username and password, this code does NOT work and breaks my testing. Specifically, the authentication dialog remains open (or displayed) in front of an open browser. I don't even know how to close this authentication dialog. How do I click 'Cancel' or 'OK' on this authentication dialog?

So, this is the problem I'm trying to solve.

I googled "selenium test invalid user in authentication dialog". From the results, I opened this StackOverflow article.
https://stackoverflow.com/questions/11522434/how-to-handle-login-pop-up-window-using-selenium-webdriver

From this StackOverflow article, there's a comment that led me to google "selenium firefox switch to alert". I see there's information on using Selenium to handle pop-up dialogs. Nice!

https://www.guru99.com/alert-popup-handling-selenium.html
https://stackoverflow.com/questions/30064528/java-selenium-firefox-driver-driver-switchto-alert-hangs-on-alert-dialo
So, I tried this and nothing from this article worked.

Further research, and I found these articles.

https://stackoverflow.com/questions/24304752/how-to-handle-authentication-popup-with-selenium-webdriver-using-java
This article has some comments which mention the use of Alert.authenticateUsing(), but seems that not all Drivers have this alert or method. At least, I didn't see it here:
https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/Alert.html

So, I googled "selenium firefox alert authenticateusing" and then read this article:
https://sqa.stackexchange.com/questions/25769/authentication-acting-as-alert-not-as-window
I tried this code, but this gave me the following error.
Error: NoAlertPresent No alert present (WARN...)
I realize this code didn't work because it's for Selenium 3 and I am using Selenium 2.53.

So, let's look into this article.
https://www.softwaretestingmaterial.com/handle-authentication-popup-window/
This article also did not help because I need to first resolve the issue with my driver not finding the alert dialog (i.e. authentication dialog).

Trying this article:
https://stackoverflow.com/questions/48823661/how-to-switch-to-window-authentication-popup-and-enter-credentials
Also, not helpful.

Trying this article:
https://sqa.stackexchange.com/questions/2277/using-selenium-webdriver-with-windows-authentication
This referenced article is great due to the author's explanation of using the Firefox add-on AutoAuth with steps to implement this solution.
http://www.codemiller.com/blog/2011/05/28/overcoming-auth-pop-ups/

Next, trying this article:
https://stackoverflow.com/questions/10395462/handling-browser-authentication-using-selenium
This also didn't provide a solution that I needed. Not for Selenium 2.

I guess I will just need to upgrade my Selenium version.

Types of Testing

Here's an article that I read recently and liked enough to share.
(In case this article is no longer available, the types covered are listed below).
https://www.softwaretestinghelp.com/types-of-software-testing/amp/

This author does an excellent job in covering most, if not all, different types of testing that exist.

Mobile Testing

One type of testing that I didn't see and expected to see is: Mobile Testing.

Calling out "Mobile Testing" specifically is useful considering our current industry of technology and how there are more users on mobile technology (like smartphones and tablets) than the traditional technology (like desktops or even some laptops).

Additional Types of Testing (not in article)

A few other types of testing important to call out are:
  1. API Testing - which is actually listed in the referencing article under Integration Testing
  2. IoT Testing - but this can be under Integration Testing
  3. Virtual Reality Testing
Soon, I expect to see Artificial Intelligence Testing even though I currently have no idea what this entails.

Either way, this goes to show that the extent of testing in the tech industry will always evolve and expand calling for better testing tools and methods. Good luck!

Different Types of Software Testing

  1. Alpha Testing
  2. Acceptance Testing
  3. Ad-hoc Testing
  4. Accessibility Testing
  5. Beta Testing
  6. Back-end Testing
  7. Browser Compatibility Testing
  8. Backward Compatibility Testing
  9. Black Box Testing
  10. Boundary Value Testing
  11. Branch Testing
  12. Comparison Testing
  13. Compatibility Testing
  14. Component Testing
  15. End-to-End Testing
  16. Equivalence Partitioning
  17. Example Testing
  18. Exploratory Testing
  19. Functional Testing
  20. Graphical User Interface (GUI) Testing
  21. Gorilla Testing
  22. Happy Path Testing
  23. Incremental Integration Testing
  24. Install/Uninstall Testing
  25. Integration Testing
  26. Load Testing
  27. Monkey Testing
  28. Mutation Testing
  29. Negative Testing
  30. Non-Functional Testing
  31. Performance Testing
  32. Recovery Testing
  33. Regression Testing
  34. Risk-Based Testing (RBT)
  35. Sanity Testing
  36. Security Testing
  37. Smoke Testing
  38. Static Testing
  39. Stress Testing
  40. System Testing
  41. Unit Testing
  42. Usability Testing
  43. Vulnerability Testing
  44. Volume Testing
  45. White Box Testing

Selenium Firefox - Test logging into two windows

I have a test case where I open first window and login. Next, I open a second window (not a tab) and I expect that I don't have to login. However, what I'm trying to understand is if the caching of the user credentials is in the browser session or not. I assume it is since I don't have to log back in (from a different window) when I'm already logged in another window that's still open.

I looked at this article, took some pointers and got the new tab to work.
https://www.testingexcellence.com/open-new-tab-browser-using-selenium-webdriver-java/

However, still working on the new window. Here's my code.

@Test
public void testNoLoginOnNewWindow() {

    WebDriver driver2;

    // Browser opened already (from @Before), login to application
    JavelinApplication.login(driver1, url, username, password);

    // Assert user's homepage displays

    // Open new browser, navigate to application
    driver2 = new FirefoxDriver(new FirefoxProfile());
    driver2.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
    driver2.navigate().to(url);

    // Assert user's homepage displays without login credentials asked

    driver2.quit();
}

This isn't quite working as expected yet. So, I read this article which didn't really help much:
https://stackoverflow.com/questions/17325629/how-to-open-a-new-window-on-a-browser-using-selenium-webdriver-for-python

But, it got me thinking. So, I re-read this article to leverage the code and open a new window from the existing open browser (similar to File -> New Window).
https://www.testingexcellence.com/open-new-tab-browser-using-selenium-webdriver-java/

Here's my code which actually worked as expected according to my test case.

@Test
public void testNoLoginOnNewWindow() {

    // Browser opened already (from @Before), login to application
    JavelinApplication.login(driver, url, username, password);

    // Assert user's homepage displays

    // Open new browser, navigate to application
    driver.findElement(By.cssSelector("body")).sendKeys(Keys.CONTROL + "n");
    ArrayList<String> windows = new ArrayList<String> (driver.getWindowHandles());
    driver.switchTo().window(windows.get(1));
    driver.navigate().to(url);

    // Assert user's homepage displays without login credentials asked
}

Yay, hooray!

Here's my reasoning between the different code used.

On a Linux env, I already have one Firefox window (#1) opened with My Application homepage displayed. When I open a new Firefox window (#2) from the OS, I must enter the username/password credentials. I enter the username/password and see My Application homepage displayed. When I open a new Firefox window (#3) from one of the existing Firefox windows (#1 or #2), I am not asked for login credentials and see My Application homepage displayed.

On a Windows env, I already have one Firefox window (#1) opened with my Application homepage displayed. When I open a new Firefox window (#2) from the OS (using Windows Start Menu -> Run -> Type firefox), I see My Application homepage displayed in window and am not asked for user credentials.

My assumption is that the different behavior is due to the Operating System. I am not sure and would need to do further research and testing, but this explanation is sufficient for now since my goal with the test case was reached. Cheers!

Tuesday, October 16, 2018

Journey into SET: Part 2 (Resume stuff)

Here's my quick, informal resume points summarizing what I have been doing as a new Test Engineer Lead.

  1. Manage all SQA activities related to ensure product(s) quality including test plans, test designs, test implementation, test execution, and test maintenance. #sqa #sdlc
  2. Verify the system according to the system requirements and bring attention to management and development team(s) of any gaps between the system and its requirements documentation. #documentation #productvalidation
  3. Lead a team of two Test Engineers. #researchandtraining #peoplemanagement
  4. Provide information useful to management and development team(s) in assisting decision-making milestones for our clients. #statusreports #teamdiscussions
  5. Contribute to making our development team(s) and process(es) better by improving our test feedback loop with positive suggestions. #teamcommunication #jira
  6. Maximize the latest technologies in testing rapid application development (RAD) to ensure high-quality product delivery to customers. #testautomation #softwareengineerintest

Selenium Firefox - Test using FindByElement( By.ClassName() )

This is very similar to the Test using FindByElement( By.XPath() ).

The change in this article is replacing the use of "xpath" obviously.

[Test Utility Class]
public static Boolean isDisclaimerDisplayed(WebDriver webDriver) {
    String modalTitle = webDriver.findByElement(By.className("modal-title").getText();
    return modalTitle.equalsIgnoreCase("Notice to All Users");
}

That's it. Cheers!

References
https://www.softwaretestingmaterial.com/how-to-locate-element-by-class-name-locator/
https://saucelabs.com/resources/articles/selenium-tips-css-selectors

Selenium Firefox - Test using FindByElement( By.XPath() )

Today, the goal is to verify the home page for a user after login. Actually, a disclaimer is displayed to the user before the user can access the home page. A modal is displayed with the disclaimer agreement and waits for the user to accept the disclaimer before the application redirects the user to their homepage.

So, the title of the modal include this text: "Notice to All Users".

I want my test to find this modal title and verify that the text is "Notice to All Users". This will also confirm that my login test passes because when I enter an unrecognized username the login dialog continues to display as opposed to showing an error message or error page. (In my opinion, this is poor design of the application and I will fix this if I ever get the time.)

My Code:

[Test Script Class]
@Test
public void testLogin() {
    Application.login(webDriver, url, username, password);
    boolean isDisplayed = Application.isDisclaimerDisplayed(webDriver);
    Assert.assertTrue("User successfully logged into Application.", isDisplayed);
}

[Test Utility Class]
public static Boolean isDisclaimerDisplayed(WebDriver webDriver) {
    String xpathRegEx = "//h3[@class='modal-title']";
    String modalTitle = webDriver.findByElement(By.xpath(xpathRegEx).getText();
    return modalTitle.equalsIgnoreCase("Notice to All Users");
}

One side of Caution here: This is slower than other methods of finding elements like by ID or by Class Name because this method looks through the entire XML formatted HTML document to find the element expected.


References
https://www.softwaretestingmaterial.com/how-to-locate-element-by-xpath-locator/
https://saucelabs.com/resources/articles/selenium-tips-css-selectors


Journey into SET: Part 1

So, I'm getting back into the game of software testing and especially with the new test automation tools and techniques. I'm going to log my journey of catching back up in this field after being in software development (away from testing to purely coding without testing - and I know this is bad). So, let's just add that I'm restoring the best practices of a software engineer.

Nowadays, it seems the new title for software testers is either Software Development/Design Engineer in Test (SDET) or Software Engineer in Test (SET) or similar. The emphasis is on the evolving skills of a tester having the capabilities to develop (or code) meanwhile advancing their techniques of applying best practices in test automation. This makes sense when we consider how the multitude of frameworks for development web application and software tools has also evolved.

Here are some articles to read.

Evolution of the Software Testing role:


One can also gain an understanding of what a test engineer (or SDET or SET) does today by looking up the job qualifications on major tech company career websites including Google (specifically "Test Engineer"), Amazon (spec. "Software Development Engineer in Test"), Microsoft (spec. "Software Design Engineer in Test").

A Quick Recap from Microsoft's Personal Experience
Here's a nice recap from Microsoft on the transition of eliminating the Software Test Engineer (STEs) and creating a "combined engineering" team.


Software Test Design
Similarly to developing any software, developing scripts to test software also should go through the design phase in order to create test structure. This helps with organizing tests to correspond to the software design, finding bugs early in the design process of software development, creating a testing framework for easier ramp-up of new Test Engineers and for easier review of the software development team, and more.

Software Test Design - Problems
First problem I'm interested in is what to name the appendages of the class files especially for the automated test scripts via the browser.
Unit Tests use the appendage "Test" like "HelloWorldTest".
Integration Tests use the appendage "IT" like "HelloWorldIT".

I've seen throughout the Selenium docs the term "AUT" (or application under test) and wonder if I should use this as the appendage for my test scripts via browser like "HelloWorldAUT". But is this sufficient?

Software Test Design - Research
https://dzone.com/articles/design-patterns-in-automation-testing

What is SOLID (Principles)?

  • Single responsibility
  • Open-Closed priniciple: open for extension and closed for modification
  • Liskov substitution
  • Interface segregation
  • Dependency injection

https://msdn.microsoft.com/en-us/magazine/dn683797.aspx (dated: May 2014)
*There are a number of terms explained in this article that I really like. For instance, the author says "when I say principle, I'm referring to a feature of the computer code that helps maintain the value of that code."


Software Testing Conferences
Here are some conferences to be aware of with respect to software test automation and the future of testing software.



Software Test Tools
There are a lot of tools from the many articles online that I've read. Not to overwhelm one with reading through all the articles and also knowing that the software tool depends on the software developed, here's a short list of tools that I'm learning and applying.

Leading the list is Selenium as the best, open source tool for testing web applications.


I should really keep track of my progress here. This is getting way too long. So I need to split this step into smaller steps and start publishing.

Monday, October 15, 2018

Loading Properties file for Test Automation

I am trying to load a simple.properties file into my test suite as soon as I run my test automation.

I tried following tutorial on Apache Commons, but I am missing the configuration2 package. I don't have time to download this and install since I'm working on a secure network.
https://commons.apache.org/proper/commons-configuration/userguide/howto_properties.html

To be exact, I need the configuration2 package for the Parameters class.
https://commons.apache.org/proper/commons-configuration/apidocs/org/apache/commons/configuration2/builder/fluent/Parameters.html

Okay, now what?

Well, let's first use basic Java to load a Properties file and test it.

I can't remember the website where I got this code from, but it is similar to the basic Java tutorial with the exception of using a BufferedReader instead of the InputStreamReader or the like. I added this into my init() method.

private Properties properties;

@Before
public void init() {
    Log.Info("Starting my test automation...");

    BufferedReader reader;
    try {
        reader = new BufferedReader( new FileReader( "src/test/resources/simple.properties"));
        properties = new Properties();
        try {
            properties.load(reader);
            reader.close();
        } catch (IOException ioEx) {
            ioEx.printStackTrace();
        }
    } catch (FileNotFoundException fileEx) {
        fileEx.printStackTrace();
        throw new RuntimeException("simple.properties file not found!");
    }
}

// Note, inside of my simple.properties file is: 
// testword = hello
@Test
public void testPropertiesFilesLoaded() {
    Assert.assertEquals(properties.get("testword"), "hello");
}

I ran this from the command line using Maven.
$ mvn -Dtest=SimpleTestAUT test -pl :app-ui

And the test passed! Yay!

Now, I need to know how to really use this properties file across my test suite. I have a Sample1AUT.java and Sample2AUT.java. In Sample1AUT.java, I have the following.

@BeforeClass
public static void setup() {
    MyProperties.loadProperties("myPropertiesFileName");
}

@Test
public void testPropertiesLoaded() {
    Assert.assertEquals("user", MyProperties.getProperty("biz.username"));
}

This is what my MyProperties class looks like.

public class MyProperties {

  static Properties properties;

  public static void loadProperties(String fileName) {

    BufferedReader reader;

    try {
        reader = new BufferedReader( new FileReader( "src/test/resources/"+fileName+".properties"));
        properties = new Properties();
        try {
            properties.load(reader);
            reader.close();
        } catch (IOException ioEx) {
            ioEx.printStackTrace();
        }
    } catch (FileNotFoundException fileEx) {
        fileEx.printStackTrace();
        throw new RuntimeException(fileName+".properties file not found!");
    }
  }

  public static String getProperty(String key) {
    return (String) properties.get(key);
  }
}

It worked, yay!

What I need to try next is loading Properties file via Krausening in case my "test/resources" folder is not deployed with the WAR including the Test Suite.

References


Monday, September 10, 2018

Not actually a minifesto

Devs,

Here's another interesting article that I just read.
http://minifesto.org/

Not sure I would agree with everything especially with calling this a "mini"festo, but I get this author's point. I also would use better terms instead of "killing the baby". Anyhow, just something to read and think about. In essence, fail fast, work fast, better is good (thanks President Obama), and keep your eyes on the win.

Discovering Datasets with Google

Devs,

If you haven't already been keeping abreast of all the data science hype, then I would suggest that you get with it. Although I haven't been able to keep up with the "hype" (and I call it "hype" because everything with computers has been on processing 'data'), this doesn't mean you have to wait for me. I'll catch up eventually. I have just have other priorities right now in this season of my life (aka two toddlers).

Here's an article I enjoyed reading. Cheers!

https://www.blog.google/products/search/making-it-easier-discover-datasets/




Tuesday, September 4, 2018

True "Agile Development"

Devs,

I'm not going to say much since some developers have the tendency to talk in circles on certain topics like "what is Agile". Instead, I am posting an article that I just read and totally agree with (who is actually one of the founders of the Agile Manifesto). I actually took part in this "experimental" phase when it came out with my first corporate job in Minnesota. From there, I've been on teams in Boston and in DC. There has only been one other team which was a Boston, small business that worked close to the principles of Agile. This is perhaps because the CTO was co-founder of the business.

Therefore, I'm realizing that for an organization to truly be Agile, one of the co-founders must be extremely technical if not a co-founder/CTO.

https://martinfowler.com/articles/agile-aus-2018.html
  1. Get rid of the Agile Industrial Complex and the idea of imposing stuff on teams. Let teams work out the way they should work themselves.
  2. Raise the importance of technical excellence, and never forget that when writing software, the technology side is really vital, and
  3. organize around products.
One area I wish Martin would have highlighted is the importance of "smart users". That is, users are who are aware of how to develop their product to make life easier. I don't mean easier like "make a better car" but visionary like "make a self-driving car". That kind of vision (which requires an imagination - thanks GE) is the kind of easier I'm referring to. Somehow, I thought with more people using all of these gadgets that people would become more creative. I'm still waiting to witness, hahaha.

Enjoy the ride!