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
Thursday, November 8, 2018
Tuesday, November 6, 2018
Software Testing Article: TestIM Era of AI
Today's article that catches my attention and has good links in it is by TestIM's webinar.
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
https://techbeacon.com/5-ways-ai-will-change-software-testing
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.- https://www.youtube.com/watch?v=HW29067qVWk (Good, in-depth explanation)
- https://www.youtube.com/watch?v=2eCHD6f_phE (Google tips and tricks)
- https://www.youtube.com/watch?v=q_BzsPxwLOE (Good, short explanation)
- https://www.youtube.com/watch?v=i40d8-Hu4vM
Labels:
big data,
coding,
data analysis,
data science,
notebooks,
python
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.
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/
Labels:
elasticsearch,
indexing,
learn,
search,
search engine,
seo
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
See details @ https://stackoverflow.com/questions/35403614/clear-browser-cookies-with-selenium-webdriver-java-bindings
Subscribe to:
Posts (Atom)