My GSoC 2016 Journey
Friday, 26 August 2016
Tuesday, 21 June 2016
Thursday, 2 June 2016
Done with the TestNG Data Provider with Excel
So I started off coding in the second week as the first week went in writing down the test scenarios. I wanted to try the @DataProvider annotation available in TestNG to carry out a generic log in test to see if it works properly. I wrote two tests, first one was Data Provider with a Java class and second Data Provider with Excel. The first one was straight forward and just needed a java object which can provide multiple parameters. The object looks like this with the @DataProvider annotation:
public class LoginDataProviderTest extends commonTest
{
@DataProvider(name = "Authentication")
public static Object[][] credentials()
{
return new Object[][]{{"dummy1","dummy1"},{"dummyUsername","dummy_password"}};
}
@Test(dataProvider="Authentication")
public void canUserLogin(String username, String password)
{
//loginPage.Goto();
loginPage.loginAs(username)
.withPassword(password)
.login();
Assert.assertEquals(loggedInCheck.isAt(), true, "Login failed");//actual,expected
}
}
This was a one step method and the test ran right away. The second approach had three steps and I found it more useful. For using Data provider with Excel, the following steps need to be followed:
The second step is reading data for which I used Apache POI.. It is a Java API for reading Microsoft documents. The APIs are seamless and can be implemented easily for excel. And the last step was pretty much the same script, the only addition was calling the ExcelReader Function with file path and sheet name.
public class LoginDataProviderTest extends commonTest
{
@DataProvider(name = "Authentication")
public static Object[][] credentials()
{
return new Object[][]{{"dummy1","dummy1"},{"dummyUsername","dummy_password"}};
}
@Test(dataProvider="Authentication")
public void canUserLogin(String username, String password)
{
//loginPage.Goto();
loginPage.loginAs(username)
.withPassword(password)
.login();
Assert.assertEquals(loggedInCheck.isAt(), true, "Login failed");//actual,expected
}
}
This was a one step method and the test ran right away. The second approach had three steps and I found it more useful. For using Data provider with Excel, the following steps need to be followed:
- Create an excel.
- Read data from it.
- Execute script.
Again, the first step is like creating a normal excel but while entering data, we should be careful about what data is entered in which column. Like if I have to test for login and I decide to test for 4 cases then i need four combinations of username and password. To take care about that it should be insured that the first column contains the username and the second password corresponding to the respective usernames or vice versa. Something like this:
| UserName | Password |
| dummy0 | dummy0 |
| dummy | dummy |
The second step is reading data for which I used Apache POI.. It is a Java API for reading Microsoft documents. The APIs are seamless and can be implemented easily for excel. And the last step was pretty much the same script, the only addition was calling the ExcelReader Function with file path and sheet name.
I found the second approach useful because even if the person running the tests does not know anything about programming can go directly to the excel and add further combinations for test. The only limitation is that she/he should know how to edit Excel :P.
Labels:
GSoC'16
Location:
Bengaluru, Karnataka 560001, India
Sunday, 22 May 2016
And the coding begins..
The coding period finally starts tomorrow, i.e, 23rd May 2016. All the 1206 selected GSoCers this year will begin coding on their respective projects. Like any other GSoCer, I am also excited to embark this journey of code, collaboration and new learning this summer. Although it is my second time as a GSoCer but I can hardly feel any difference in my excitement level :P. I have already updated my proposal and timeline after the project assignment for AUT. The only thing left now is to code, code and code.
The Community period although does not include any coding stuff officially is a great time to know people in your organization. It feels great to meet people who are equally passionate about FOSS. And this year with the facebook group I have come across people not just in my organization but from all the selected organizations. People have already started sharing their blogs and projects. This is surely a plus point this year as compared to last year.
Bdw, the scheduled hangout with my mentor could not happen as she was travelling then and I have re-scheduled it to 28th May 2016. My timeline for the first week looks rather neat, I will be working on the test scenarios and running some dummy tests to test the dev environment. I will be working on Windows 10 with Eclipse as my IDE and Selenium as the framework along with Maven as the build tool, TestNG for the test scripts, Jenkins for continuous integration and Saunce Labs for running tests on the cloud. All my codes will be available on Github in the Systers AUT repository. It is empty now, will be updating it shortly. Stay tuned!
Let the coding begin! :D
Labels:
GSoC'16
Location:
Bengaluru, Karnataka 560001, India
Sunday, 15 May 2016
It happened again!
After GSoC in 2015, I had in mind that I would be applying for it again but I was not sure as we are never sure about anything :P. In the mid February when the selected organizations list was announced, Systers was one of the organization. I was working for Systers last year and I thought of applying for the same project again, so I submitted a proposal for same.
On the midnight of 23rd April 2016(technically 24th April in IST) the selected students list was announced but I was't awake at the time results were announced. Somehow I got up at 0300 hrs and checked my phone lying next to me on bed and saw an email which broke my sleep for the rest of the night. Yes!!Yes!!Yes!!:D I had done it again. For the rest of the night, needless to say I couldn't sleep. I kept staring at the email for a while and later opened the laptop to see the complete list of projects for Systers as I knew some of the students who were selected.
The very next day I contacted my mentor, Mariam Kiran to introduce myself and to discuss my project timeline and other project related details. There are six students in total whose proposals were selected for Automation Testing(AUT). Once we were assigned the projects for which we have to develop the AUT Framework, the next few days were spent on getting in contact with Akanksha, the student who will be working on PCSA(Peace Corps Safety) Web Application for which I have to develop an Automation Testing Framework and editing my generic proposal to a more specific one for AUT PCSA Web.
Then on 8th May 2016, a AUT Bonding Session was organised by Shwetambara, my last year's mentor so that students get to know each other and ask their queries related to the project. The session began with the introduction of each of us present in the session. I met Daisy, Shraddha, Vatsala, Madi, the other AUT students and also two of the mentors, Nidhi and Shweta. I knew Shweta and Daisy from last year but others were new and it was really nice to meet with them. After the introduction, Shweta walked us through what they expect from us during the program and how to reach out to them if we have any queries and problems. She was very warm and friendly and made us feel at comfort and ease about our projects. The rest of the session went with Q&A.
I am spending most of the time now learning about technologies which I would be using for my project this year. I had done this project last year but I plan to use new technologies this year like for TestNG instead of JUnit, cloud service like Sauce labs for cross browser and platform testing and Jenkins for continuous integration which I couldn't cover last year. The next thing I am waiting for is my first hangout session with my mentor which is scheduled for 21st May 2016. Lets see how it goes :D
Happy Coding!
My Project on GSoC'16 site
|
GSoC'16 selection email
|
Labels:
GSoC'16
Location:
Bengaluru, Karnataka 560001, India
Subscribe to:
Comments
(
Atom
)