August 10, 2016 02:43
June 15, 2016 20:02
Blogger
Converting Test to NUnit
- Converting tests to NUnit is not very hard; we had to do some restructuring, but it was no big deal.
- But the tests are not running in parallel like we want them to. We aren't really sure why this is, but we think it has to do with how the code was structured.
- We have now decided to scrap everything and start from scratch instead of trying to work with the existing code.
June 10, 2016 23:29
Blogger
Parallel Test Execution
First, running tests in parallel is actually not up to Visual Studio, Selenium Grid, or the language you are using (Ex: C#). That task falls onto the test runner as long as it supports it. The built in test runner on Visual Studio is called MSTest, and it doesn't support this function automatically. I read on some sites that you are able to change some stuff around to force it, but its not worth it in my opinion.
Second, there are a few different test runners that can run multiple test at once. The ones that I found are NUnit and XUnit for C# and TestNG for Java. I'm sure there are more, but those are the ones that I looked into. There are many differences between NUnit and XUnit, but it looks like NUnit is the one that is most like MSTest and therefore would require the least amount of work in converting the test to be compatible in NUnit.
Third, I had been looking for a while on some tutorials, but since I didn't really know what I was looking for I had a hard time. Once we had settled on NUnit as the test runner for the project we are converting, I was able to find a tutorial series on YouTube that explains in great detail how to run multiple tests at once and even how to run the same test using different browsers.
Now that we know what we are doing, we will be working the next few days on getting a few test converted over and see if we can get it to work properly. That's all for now, thanks for reading!
June 7, 2016 23:36
Blogger
Test Execution Using Selenium Grid
First, there is only a few lines of code that we need change in order for it to work. If you remember my last post on Selenium, I will be using the same code I did then and just update it.
The new code looks something like this:
using System; using System.Diagnostics; using OpenQA.Selenium; using OpenQA.Selenium.Chrome; namespace SeleniumTest { class GenerateTokens { private RemoteWebDriver driver; public static void Main() { Generator(); Environment.Exit(1); } private static void Generator() { var capabilities = new DesiredCapabilities(); capabilities.SetCapability(CapabilityType.BrowserName, "chrome"); capabilities.SetCapability(CapabilityType.Platform, new Platform(PlatformType.Windows)); driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), capabilities); driver.Manage().Window.Maximize(); driver.Url = "some-site.com"; for (int counter = 0; counter < 10; counter++) { // Do something } driver.Quit(); } } }
As you can see, we use a RemoteWebDriver object instead of just a IWebdriver like we did before. This basically is saying that the test will not be running locally (but it can, more on that later) and that we will be using Selenium Grid to run the test on a different machine. We specify that we want to run the test on a machine that has Chrome as the browser and that its also a Windows machine. After that, we don't really care what computer is running those test, all we care is that it meets those two requirements for the test.
But if you were to run this test now, it would fail, because it wouldn't be able to run the test locally. The test runner is looking for an instance of Selenium Grid at the address that you provided "http://localhost:4444/wd/hub" and it can't find it. Now you have to set up the grid with only one hub and at least one node to run the test. Here are the steps for the set up:
- First you have to have Java installed in your machine and make sure that it was added to your PATH.
- Next download "Selenium Standalone Server" from the Selenium downloads page. And put it in a folder that you want, I created a folder in my C driver called Selenium for it.
- You will need to open a command window and navigate to the folder and enter: "java -jar selenium-server-standalone-2.53.0.jar -role hub"
- You will then need to open a new command window and navigate to the folder again and enter: "java -jar selenium-server-standalone-2.53.0.jar -role node -hub http://localhost:4444/grid/register"
We are still running into issues at work where we can't get the tests to run in parallel, but hopefully we will figure it out soon. That's all for now, thanks for reading!
June 3, 2016 15:13
Blogger
Baptized by Fire
For the last week I haven't been doing much, other than getting to know what the automated tests look like that we run on our website. But now I have been given my first assignment, luckily I won't be working on it alone. Another guy started at the company a few days before I joined the team last week, and while he has a ton more experience we are both new to QA Engineering in general, so they decided to pair us up.
We are going to be working on a few different things:
- Moving the automated test from an old TFS server and getting it all migrated to GitHub.
- Update the test to make sure they run on Selenium Grid.
- Update the tests to that we can run multiple tests at once in parallel using Selenium Grid.
- Make the tests run/kick-off from GitHub instead of TFS when a new build gets pushed to the QA environment.
May 25, 2016 02:51
Blogger
To Do App - Finished
The screenshot above is of my home page, its really similar to my mockup that I created a few days ago. The biggest difference is that I added tabs to the task list. One tab shows tasks that are outstanding, and the other shows the tasks that have been marked as completed.
The reason I added the separate tabs is that I didn't really know what to do with the tasks that were marked as done. I didn't want to delete them from the database, and I didn't want to leave them in the same list as the outstanding tasks. I decided that having a list of completed tasks would be the best thing to do.
Adding a new task also didn't work out as I wanted it to. In my mockup, I had planned to use a modal that would keep the user in the same page, but I couldn't figure out how to do it that way. The only way I could add a new item was to go to a dedicated page for adding a task, and then take the user back to the homepage with the new task.
On the home page, each task has three buttons that allows the user to perform an action on the task that it belongs to: Edit, Details, & Delete. Delete is self explanatory, it simply deletes the task from the SQL database and by extension from the list.
Edit and details are almost the same, so I will cover them at once. Edit allows you to go into the task and update any information for it. For example: if you need to add notes or change the due date you can do that in the edit page. The you save it and it updates in the database as well as on the list. This is also the page to mark the task as "Done" when you have completed the task. I was trying to figure out how to do it from the home page, but I couldn't.
The details page is exactly like the edit page, but its a "read-only" version and you can't change any of the information, you have to go to the edit page to do so.
And finally here is my database that I set up on MySQL. Its a really simple table with only 6 columns. The book that I got on SQL really helped me out on how I should set up the table. I am not done with the book yet, I think I am only a 1/4 of the way done with the book, but I already know way more than I did a week ago about SQL.
I will try to keep working on the app if I have time to make it better and work from a single page, but for now I am done. I am super nervous at the moment since I start my new job in the morning (its almost 1 AM), and I don't really know what it will be like. But I am ready and I hope that I leave a good impression so I can stay on the team after the 90 day trail ends. That's all for now, thanks for reading!
May 22, 2016 12:20
Blogger
To Do App - Mockup
This is the home page, where it will show the list of outstanding tasks with a few buttons for actions on each task.
To add a new task, I want to create a modal that would allow the user to type in all the important information and then add it to the list.
As I mentioned before, this is just a mockup, so none of it is actually being persisted on a SQL database. I don't really know how I'm going to do all this, but I am still working on it. All that you see up there is just some tweaking that I made to the sample project and some simple UI updates using Bootstrap.
That's all for now, thanks for reading!
May 20, 2016 19:58
Blogger
Prepping for the New Job
Over the next few days I plan to learn as much as I can about SQL and websites using the MVC framework.
The first is obvious, like I've said before, my knowledge of SQL is very limited. I know that I won't become a SQL master over the weekend, but I hope to know at least the basics. My job actually bought me a book that I can use called Teach Yourself SQL in 10 Minutes. There are plenty of free resources available online to help me, but my manger thought this would be a better option so they got me the book for free. I really love working there.
I will also try to build a simple website using ASP.NET and the MVC framework because that is usually what new developers do in the company. For the first few weeks, new developers have to build a simple To Do List web app. Basically its an app that should allow a user to keep track of tasks, a user should be able to: Create, Read, Update, and Delete tasks. These tasks should be persisted to a database of some kind. Normally they use a NoSQL data base like RavenDB, but since I am learning SQL I will use MySQL DB for this web app. I don't know a single thing about web development, but I will try my best.
That's all for now, thanks for reading!
May 18, 2016 17:27
Blogger
So I Got the Job...
Basically what happened is that a couple of other people had applied for the position, but on the day of their interview (yesterday), they canceled since they had accepted job offers somewhere else. So I guess by default I got it?
I know that I shouldn't be happy that I got the position by pure luck, but I am truly grateful that they decided to give me an opportunity since they could have easily just kept looking for someone else. Since there was a lot of stuff I didn't know about databases in general, I am actually joining the team as a temp. If I do well in the first 90 days, then I get to stay on the team. I am going to give it my all and try to learn as much as possible in this position. I hope that with this job I will get the required experience needed and one day be a full fledged QA Engineer one day.
Needless to say, I am super happy right now and I can't wait for this next challenge. I am also super nervous, but I will just face it as it comes.
That's all for now, thanks for reading!
May 16, 2016 23:33
Blogger
Jr QA Engineer Interview
The interview started with some SQL and database questions. I had tried to study some basic SQL stuff over the weekend, but I didn't think that they were going to ask me anything about it, I figured they would focus more on my C# experience. Since my experience with SQL and databases is very limited, I think its safe to say that I failed this part of the interview.
Next they moved on to some OOP (Object Oriented Programming) questions and I'm happy to say that I did much better in this sections. They asked me a few different questions on what inheritance was, when would you implement inheritance, and a few other questions. I struggled a bit on explaining myself, but I got through it.
Next was probably my favorite part, actual coding on a white board. They asked me how I would write a function that would calculate the factorial of a given number. This part I spent probably a couple of minutes since it was really straight forward. This is the code I wrote:
public static int Factorial(int n) { int result = 1; for (int i = n; i > 0; i--) result = result * i; return result; }
They looked at the code, and told me it was good. Then they asked me to rewrite the function using recursion. I struggled a bit on this part, I had trouble trying to put into code what I had already done in a different way. They gave me a hint saying that 5! = 5 * 4! and that was all I needed. Here is the code I wrote:
public static int FactorialRecursive(int n) { int current = n; if (n == 1) return n; int next = FactorialRecursive(n - 1); return current * next; }
Overall I think I did much better in the second part of the interview than the first. I am not too hopeful on getting the position, but at least now I know what I need to work on and I am ready for the future. That is all for now, thanks for reading!
May 11, 2016 23:40
Blogger
Learning Selenium WebDriver
Since I am a QA Specialist, I've heard the buzzwords "selenium" and "automated test" thrown around the office, but I didn't really know what any of those were. So I decided to start looking into it and try to understand how Selenium works and how to make automated test.
After spending sometime looking at some videos on Pluralsight, I got the basic idea that basically you can use a programming language like C# and write a "script" on what you would like to do in a website. I did some basic examples, but I didn't really think about it until yesterday.
In my current project at work, we are currently working on migrating our existing database from RavenDB to MartenDB. There are many documents that we have saved in the Raven database, and we are going to migrate each type of document. But in order to test it correctly, we were trying to find a simple way that would allows us to generate a lot of activity on the site, like customer's trying to reset passwords and see if it would affect the migration.
I had the idea that I could write a Selenium script that would do this for us on the site. Here is what I came up with:
using System; using System.Diagnostics; using OpenQA.Selenium; using OpenQA.Selenium.Chrome; namespace SeleniumTest { class GenerateTokens { public static void Main() { Generator(); Environment.Exit(1); } private static void Generator() { IWebDriver driver = new ChromeDriver(@"C:\Libraries\"); driver.Url = "some-site.com"; Debug.Assert(driver.PageSource.Contains("A message has been sent with directions on how to reset your password.") == false); for (int counter = 0; counter < 100; counter++) { driver.FindElement(By.Id("forgot-link")).Click(); IWebElement email = driver.FindElement(By.Name("Email")); email.SendKeys("some-email@some-domain.com"); driver.FindElement(By.ClassName("btn-primary")).Click(); driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(2)); Debug.Assert(driver.PageSource.Contains("A message has been sent with directions on how to reset your password.") == true); } driver.Quit(); } } }
This script would essentially go to a site and go through the steps a customer would take to recover their password on their account. The script would repeat it 100 times (but it can be increased if we wanted) and we wouldn't have to worry about doing it ourselves manually. The downside to this script, is that it would perform the same action for the same account/email address provided. I was thinking of maybe modifying this script to read a text file that contained a lot of different email address that it would just input on the site.
I don't think this script will actually get used at work since I am not a QA Engineer, and I think they might have a better approach at doing this with some internal tool, but I thought that it was interesting how easy this was to write.
Anyways, that's all for now. Thanks for reading!
May 11, 2016 00:37
Blogger
The End of Disney Infinity
I haven't worked at Avalanche since September of last year, so I don't really know what went down but all my friends that still worked there are really shocked at the news. I just hope that everyone there is able to find another position at other studios soon.
I was only a game ester in my short time at Avalanche, but I loved my time there and it thanks to them that I am now a software tester.
That's all for now, thanks for reading!
May 8, 2016 21:14
Blogger
Caesar Cipher in C#
So I was kind of bored over this weekend, and I decided that it would be a good exercise to write a Caesar Cipher. Here is my code:
class CaesarCipher { private string Sentence; private int EncryptShift; private int DecryptShift; private bool IsEncrypted = false; public CaesarCipher(string input, int shifting) { Sentence = input.ToLower(); EncryptShift = shifting; DecryptShift = -shifting; } public string Encrypt() { if (IsEncrypted) return Sentence; char[] char_array = Sentence.ToCharArray(); Shuffle(char_array, EncryptShift); Recunstruct(char_array); return Sentence; } public string Decrypt() { if (!IsEncrypted) return Sentence; char[] char_array = Sentence.ToCharArray(); Shuffle(char_array, DecryptShift); Recunstruct(char_array); return Sentence; } private void Shuffle(char[] char_array, int shift) { for (int index = 0; index < char_array.Length; index++) { char letter = char_array[index]; if (letter >= 'a' && letter <= 'z') { letter = (char)(letter + shift); if (letter > 'z') letter = (char)(letter - 26); else if (letter < 'a') letter = (char)(letter + 26); } char_array[index] = letter; } } private void Recunstruct(char[] char_array) { Sentence = null; foreach (char letter in char_array) Sentence += letter; IsEncrypted = true; } }
That's all for now, thanks for reading!
May 4, 2016 23:11
Blogger
Max & Min Heap
While I was working, I found that 99% of the code was going to be the same, and I didn't want to just create a copy and tweak a few lines. So instead I decided to create a abstract Heap class that I could inherit from.
So I created the base class and moved most of the code to that file. Then I made the Max and Min Heap classes and made the changes required in each class to make it work. While this also wasn't that hard, I think that it was a good exerciser. I did something similar in the Components assignment, but I think this was a much better example of how to use inheritance.
Here is my code:
That's all for now, thanks for reading!
April 29, 2016 13:48
Blogger
Stack Class in C#
Since I was bored at work, I started thinking that we never created a stack for one of the class assignments. So I decided to create my own, which wasn't that hard since its essentially just a wrapper around an array.
I started to work on it yesterday for a couple hours and finished it this morning.
Here is my code:
Thanks for reading!
Archive
- September 2016
- August 2016
- June 2016
- May 2016
- April 2016
- March 2016
- February 2016
- January 2016
- December 2015
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- November 2014
- October 2014
- September 2014
- August 2014
- June 2014
- May 2014
- April 2014
- March 2014
- February 2014
- January 2014
- December 2013
- November 2013
- October 2013
- September 2013
- August 2013
- July 2013
- June 2013
- May 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- November 2012
- October 2012
- September 2012
- August 2012
- April 2012
- March 2012
- February 2012
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
Since I don't know much about Substance Designer, I looked up a tutorial to get me back into it and I created a metal floor texture following this tutorial:
I really like this guy since he takes his time to explain the tool at the beginning and all. This will be really useful for anyone that is new to the software package. Without further ado, here are a couple renders from the finished product:
It took me a bit over an hour to finish the tutorial and about 15 minutes to get a good render on Marmoset Toolbag, but I am really happy with the result. I forgot how awesome this software package is, and I look forward to working on one of these textures every week if I have time from now on.
That's all for now, thanks for reading!