by admin | Dec 28, 2021 | Manual Testing, Blog, Latest Post |
It is an undeniable fact that automation testing has greatly improved the efficiency of the software testing process. But that doesn’t imply that automation testing alone is sufficient to achieve maximum quality. Despite being a top-tier automation testing company, we are also experts in delivering the best manual testing services as we believe that manual testing can never be replaced. We feel understanding this fact plays a huge role in helping us deliver comprehensive software testing solutions to our clients. If you feel otherwise, we believe we can make you cross the aisle by the time you finish reading this blog. If you already believe that manual testing is important, then great. We’ll jump straight ahead and explore the various factors that explain Why Manual Testing is Important.
The 8 Reasons Why Manual Testing is Important
- 100% Automation Isn’t Possible
- There is Scope Beyond the Pass and Fail
- The Human Touch
- Automation Isn’t Easy
- Automation Isn’t Inexpensive
- Repeatability Isn’t the Only Ruling Factor
- It is Hard to Keep Up with Changes
- Automation Isn’t the Purpose of Testing
100% Automation isn’t possible
Right off the gate, we want to establish the fact that not all tests can be automated as per the needs. Even before analyzing if it’ll be wise to use automation or not, one must consider if it’ll be possible to automate the test. For example, mobile app test cases can be very much complicated. Even the smallest of issues like excessive touch inputs or an incoming call might disrupt the performance of your app. If you are testing an infotainment system that depends on external hardware to be plugged in, you wouldn’t be able to completely automate that too.
The biggest obstacle would be compatibility across different devices. You might use a tool like Selenium to test your web application in various browsers, but you can’t be sure if your webpages are rendered correctly as per your design. That is why your goal shouldn’t just be to get your automation test to pass.
Beyond the Pass and Fail
Let’s say you can automate most of the tests. Should you do it? Just because you can automate, doesn’t mean that you should implement it immediately. We all know that one of the software testing principles says that “Absence of errors is a fallacy”. Likewise, just because your automation test passes, it doesn’t mean there are no issues. As of now, there is simply no alternative to testing user experience manually.
Apart from that, the functionality might work and still not fulfill its purpose or function effectively. If you check if all the buttons on a webpage are working, your automation script will pass if it simply works. But what if the button is not in a comfortable position for the user to click easily? Or what if the color of the button doesn’t make it easily visible as it blends with the background? The results no longer matter in such scenarios. Even integration and localization issues will easily fly under the radar if you rely solely on automated tests. Since the user experience is a very important criterion that affects the success factor of products, you simply can’t afford to neglect the human touch that manual testing provides.
The Human Touch
If applications have only the bugs that we anticipate, then software testing will become very easy. If you have been a software tester for at least a short period of time, you will know that bugs tend to come in the most unexpected ways. Yes technologies like A.I and machine learning have made automation more effective over the years. But beating the human mind’s analytical thinking, experience in the subject matter, and strategizing would be very hard. That is why techniques like exploratory testing are very critical in unearthing the bugs that can’t be detected easily.
Exploratory Testing in an Agile Environment is also important as it will help you understand the product better with the high-quality data you gather from it. So you’ll be able to keep up with the constantly changing requirements that come in Agile. Even if you’re not in an agile environment, manual testing will definitely help you understand the product a lot better. But you have to make sure to test it from a user’s perspective and not just with the motive to get the tests done.
Automation Isn’t Easy
You also have to understand that Automation testing is not a cakewalk. You have to be clever enough to use it effectively by following the various Automation Testing Best Practices and Tips. Without the right personnel who are capable of handling automation and the right tools that you would have to know to use well, effective automation might become very hard to achieve. So if you start without proper planning and begin to fall behind in every sprint, then automation testing will soon start to become a nightmare for you.
Automation Isn’t Inexpensive
At times the cost of something might outweigh the benefits it brings to the table. Likewise, automation on a large scale will be ideal as it would be better to get a return on your investment. But what if you had a small project at hand? The chances of you getting a return on your investment would be very slim. Automation isn’t done once you’ve written the scripts at first, you have to maintain them as well.
So following a concept called ‘Tripwire Testing’ can be used to get the best return of investment in your automation testing. Tripwire testing is nothing but using the smallest number of automated tests that will be needed for the testers to detect where they will be able to find critical bugs in the system.
The Repeatability Factor
Even if you had to perform tests like smoke tests on a large-scale project, it would be wise of you to automate them. If the tests are not repetitive in nature, then automating will not make much financial sense. Likewise, if there are any bugs that are detected post-release, then manual testing can be employed to quickly recreate the issue and generate a bug report. You can’t be sitting around and writing an automation script for such simple demands.
Though repeatability is important, it isn’t the only factor as variations are also a key aspect. Like how Albert Einstein said that “Insanity is doing the same thing over and over again and expecting different results.” You just can’t keep repeating the tests over and over again.
Hard to keep up with Changes
If you are working in an agile environment, then it is extremely hard to keep up with the various changes that could impact the User Interface, the features, or the product flow. Each change will mean that you would have to make changes or even rewrite automation scripts. Testing at the early stages of software development can definitely help us detect issues at the early stages and solve them with ease. But this is the phase of the software development lifecycle where constant changes keep happening. Updating your automation script for every change will become a cumbersome task that will not yield you much use as early phase scripts don’t last long.
Automation isn’t the purpose
By now you would have understood that automating your tests isn’t the purpose of testing. So if you’re too held up on automating your tests even though it wouldn’t be financially viable or good for your product, then you would be able to focus on delivering quality. There is so much more to testing than just detecting bugs or passing the tests for that matter. You should never lose track of the big picture in the pursuit of automating your tests.
Just because an ingredient makes a dish taste really well doesn’t mean you should use only that ingredient and leave the other required ingredients out. Since it is clear that both manual and automated testing are important ingredients needed to attain quality, you must understand that the purpose of automation shouldn’t be to just make it mimic human behavior. As stated earlier, automation’s purpose should be to enhance the overall product quality. Focus on aspects like quality assurance based on what you’ve learned with the help of manual testing to create a much larger impact.
Conclusion
It can be very easy to forget that software testing is a process of discovery and just focus on automation. Instead, automation must be used to swiftly repeat whatever we know so that we will have enough time and resources to discover what we don’t know. And manual testing is one of the best ways to explore to unknown. So as one of the best QA companies, we are confident that manual testing will not be going away anytime soon. We started by saying that 100% automation isn’t possible and we want to make sure you don’t take it the wrong way and opt-out of automation as soon as there is a challenge. So it would be better to look at it from a different perspective and move forward by saying that 100% of the tests that should be automated to get the maximum quality, should definitely be automated.
by admin | Dec 24, 2021 | Automation Testing, Blog, Latest Post |
As the name suggests, Endtest.io is a great option if you are looking for a great option for automating your end-to-end and regression testing. The best part about Endtest.io is that you could do all this for both mobile and web apps without having to code. So the end result here is that you get is quicker evaluation of quality for your products since it is instrumental in overcoming the bottlenecks that come with traditional testing. Being one of the best automation testing companies, we are always on the lookout for the best tools that can streamline our automation testing process. Endtest.io is one such tool that we have found to be very resourceful. So in this blog, we will be exploring why you should consider Endtest.io, and help you get started with it as well.
Why is end-to-end testing (E2E testing) Important?
E2E testing is crucial as it helps to thoroughly test the entire software by modeling and validating real-world scenarios. Since it is executed from the standpoint of an end-user, it helps establish system dependencies and guarantee that all features & integrations function as intended. So the chances of a system failure due to the failure of any of the subsystems becomes very less.
Why Endtest.io?
If you have done your own research on test automation solutions, you might have come across Selenium which is a very popular open-source tool. But Selenium lacks various features such as native video recording of tests, integrations with Jenkins, Jira, or Slack, e-mail notifications, and test scheduling. That is where Endtest.io comes into the picture as it addresses all these issues to give you a complete package.
Endtest.io is simple to use and has a very intuitive user interface. So even junior QA Engineers can work with it without any prior experience. Endtest’s website is also surprisingly simple to use and offers a lot of helpful documentation that can guide you through any doubts. If you are still finding it hard to resolve an issue or if you need additional help, you can reach out to their super responsive customer service via email or chat to get swift replies. Since they are open to suggestions that can help better your workflow or their product, you can approach them with your ideas. In fact, we have already discussed an option to include special characters with their team.
As stated earlier, we can also use Endtest.io to automate regression tests. Similar to E2E testing, regression testing is also very important and it will ensure that a recent program or code modification hasn’t broken any current features of the product. So regression testing becomes a must when introducing new features, repairing errors, or dealing with performance difficulties.
Getting Started with Endtest.io’s End-to-End testing
Now that we have seen the capabilities of Endtest.io, let’s find out how you can start using it. First and foremost, you would have to Sign up to EndTest by visiting this link and then log in using the valid credentials. Once your account creation is complete, you’d have to install the Endtest.io Chrome Extension (Web test recorder Codeless Automated Testing). So you needn’t have to download any separate software for Endtest.io to work.
Recording Function
Once you open the Chrome extension, you’d have to select either the ‘Start from here’ or the ‘Start from URL’ and hit the ‘Start Recording’ button.
So Endtest.io will now record each and every step you take while performing the test scenario. If needed, you can even pause the recording at any given moment. Once you’ve finished your test scenario, head back to the Endtest.io Chrome Extension and click on the Stop recording button.
Endtest.io has some predefined settings from which we can choose different options based on the testing requirements and needs. These user-friendly options shown in the image make it even easier for us to use the recording feature with full accuracy.
Test Case and Test Suite
So once the recording part has been done, you will be able to assign a name to the test case you just recorded. If you want to add the test case to an existing test suite, you can do so. If not, you can also create a test suite and add the test case to that.
For the sake of explanation, we have named this test case as ‘Codoid’ and created a test suite by the name ‘Demo’. Once you press the ‘Save’ button, you will be taken to the Endtest.io site’s Web Tests page as shown below.
As seen in the image, there are various options such as edit, run, export, and so on. But since we’re not trying to do any of that with the test suite now, let’s just click on the Test Suite named Demo.
Inside you will find all the test cases that you have created under that particular Test Suite. In this case, we have created just one test case named ‘Codoid’. So let’s click on that to see the steps that were previously recorded.
So it is evident here that the test case can be edited without any hassle as there are options to skip, move, and even remove a particular action which we had recorded earlier. In addition to such basic options, you can even edit the type of action that you recorded and choose the type of locating technique that you want to use.
Conclusion:
With all such easy editing options and its ability to easily generate all the possible locators for the particular function in the application, Endtest.io makes it easy to write, edit, and scale automation scripts for even complex applications. In addition to that, you also be able to view detailed results of the execution, take screenshots, schedule the test execution, detect changes, and so much more. Here at Codoid Innovations, we are always focused on delivering true automation solutions that require no interference or supervision. Endtest.io is an automation tool that helps us achieve this target and enable us to provide our clients with top-notch automation testing services.
by admin | Dec 24, 2021 | Software Testing, Blog, Latest Post |
Today, hardly anyone doubts the need for rigorous software testing. In fact, the experts agree: in 2015, a military airplane crashed into the ground, killing those on board. The evidence later showed that an error in the programming caused the crash. Without extensive tests to check every line of code, could this tragedy have been prevented? The experts seem to think so.
Most bugs are not tragic. However, when a company tries to save money on testing, maintenance costs usually skyrocket later on. In many countries, more and more software development companies realize this because the demand for both manual and automation QA testers is growing steadily.
Unfortunately, there is one problem with being a tester, and it is a big one: there just aren’t enough of them. With all the successful game franchises and new, exciting products constantly in development, more and more people are considering QA as a career choice, which means that the competition for jobs is getting fiercer. At the same time, more and more companies are offering premium wages for testers with proper skills; this creates an even greater incentive to learn how to test. And yet, before you quit your current job to become a full-time tester, you have to ask yourself, “what do I need to be a successful tester?”
Codoid, one of the best automation testing companies, answers this question:
Excellent Communication Skills
Although it may seem strange for a tester, communication is one of the essential skills for any software tester. After all, what would be the point of testing a product if no one told you whether it passed? If a tester cannot properly communicate what they have found to their team, that tester is of no use to the company. They will be of even less use if they cannot communicate what needs to be done. A tester who cannot write professional bug reports and clearly explain how to fix the bugs will cause endless frustration on the programmer’s part and messy, confusing code on the programmer’s output.
Curiosity
Programmers are too familiar with their code and too eager to move on to the next thing to look for bugs. Testers, however, have a more objective methodology: they know that even the tiniest slip-up can have disastrous consequences. This is why it is invaluable for testers to be curious. They need to be able to ask “what if?” and test every possible outcome, no matter how unlikely it might be.
Analytical Thinking
A tester needs to find errors in that sequence and infer how the test should be carried out to meet the desired results. A tester needs to see the big picture, not just the individual lines.
Attention to Detail
Testers are finders of small, seemingly trivial errors. To them, every detail matters. They will notice if a word is misspelled, a button is positioned in the wrong place, or a graphic is out of place. Although it is not very glamorous, it is an essential part of the job.
End-User Perspective
To effectively test a program, a tester needs to have an end-user perspective. What is the feature supposed to do? How does it work? And, more importantly, how is it supposed to make the users feel? A tester needs to imagine himself as a regular user and think like one. The whole point of testing is to ensure that the end-user is getting what he wants and needs.
Conclusion
It is not easy to become a tester, but it is hardly impossible. The only thing you need to do is ask yourself this: do I meet all the requirements? If yes, you’re on your way to a successful career. If not, maybe it’s time to start. Whether you decide to learn how to test on your own or at a school, numerous free resources are available online. You can begin with the basics: go over testing terms and definitions, perfect your test planning skills and learn how to use test scripts. As you get more comfortable with the material, start testing yourself: play a game and think about how to test it, and when you’re ready, you can start looking for work in QA companies.
Codoid is one of the most reputable automation testing companies that offer reliable services to various businesses and organizations. Contact us today to find out how we can help you!
by admin | Dec 23, 2021 | Automation Testing, Blog, Latest Post |
As the name suggests, codeless automation testing is the process of performing automation tests without having to write any code. Codeless Automation Testing can be instrumental in implementing continuous testing as the majority of automation scripts fail due to the lack of proper coding. It will also enable you to focus more on test creation and analysis instead of worrying about getting the code to work, maintaining it, and scaling it when needed as well. So if you are fairly new to codeless automation testing, then you will find this blog useful as we will be pointing out the advantages of codeless automation testing by comparing it with Selenium Testing. So let’s get started.
How is Codeless Automation Testing Different from Selenium Testing?
Selenium is a tool that greatly simplified the automation testing process. It even allows software testers to record their testing and play it back using Selenium IDE to create basic automation. But there was no easy option to edit the created test cases without being strong in coding. So if you weren’t strong in coding, the only other option would be to rerecord the entire test. But now with the introduction of codeless automation testing, you can go beyond the record and playback technique. So the scope of usage is broadened as it even makes it possible to edit the test cases with basic HTML, CSS, and XPath knowledge. Owing to the minimal use of coding, tests can be easily understood by people without much programming knowledge as well. To top it all off, the setup process is so simple that you can set it up in no time.
Getting Started with Codeless Automation Testing
So it is evident that codeless solutions are a lot more powerful in comparison. But one has to keep in mind the fact that it will work effectively only if they are used appropriately. It is always a good idea to get started with simple tests that can be validated easily. For example, if you are testing an e-commerce product, start by seeing if you are able to add a product to the cart. Once you familiarise yourself, you can go a notch higher and try testing the purchase and return/exchange process. It wouldn’t be wise to use codeless solutions in products that use third-party integrations or has a dynamic and unpredictable output as it becomes very difficult to validate them.
Local and Cloud Options
You can either opt for local codeless solutions or cloud-based solutions. As one of the best automation testing companies, we always prefer cloud-based solutions as they offer more advantages. Collaboration is one of the main plus points as it will enable seamless sharing of test data and test scenarios. In addition to that, you will be to scale your services better with the help of the many virtual machines and mobile devices available online. Since your infrastructure becomes more robust, your overall process quality will also drastically improve.
The Future of Codeless Automation Testing
Though complete codeless automation isn’t yet possible in the same way how all manual tests can’t be automated, it is the natural next step that testers have to take. Repetitive tests were replaced with automation using scripts and now repetitive automation coding is being replaced with codeless solutions that utilize machine learning and AI. But as it always has been, manual testing and scripted automated testing will still play a major role in software testing.
by admin | Dec 22, 2021 | Accessibility Testing, Blog, Latest Post |
Performing comprehensive web accessibility testing for any website is no easy task. There are so many guidelines to be followed to become compliant with standards like WCAG. But at the same time, you have to at least make sure to make your website is accessible on a basic level. So we have created this basic Website Accessibility Testing Checklist with reference to the easy checks issued by W3C. Though they are not definitive methods, it’s definitely a great place to start and evolve from that point onwards.
A Basic Website Accessibility Testing Checklist
- Page Title and Content Headings
- Alt Text and Multimedia Alternatives
- Moving and Flashing Content
- Text Size and Contrast ratio
- Keyboard access
Page Title and Content Headings
Since Page Titles appear in search results, browser tabs, bookmarks, and so on, make sure to make it clear and unique. See if the main content is properly visible in all these places and use a screen reader to see if it read properly. Unclear page titles will make it very hard to navigate across different pages.
Using headings in a random order will make it hard for the user to understand the structure of your content. So in addition to confusing regular readers, it will also confuse the screen readers and cause them not to function properly.
Alt Text and Multimedia Alternatives
Alt Text and Multimedia Alternatives are key points in our Website Accessibility Testing Checklist as websites are now filled with a lot of visual content. Visually impaired users won’t be able to see any graphical content that you use on your webpage. So if you are adding an image, make sure to add appropriate alt text to the images as that will help the user understand the purpose of the image using words. Similarly, make sure to add closed captions and transcripts for videos based on the type. The media shouldn’t always start to play as soon as the page opens. Even if it does, then make sure to make it easy to pause it by adding keyboard controls for the playback.
Moving and Flashing Content
Carousel posts on websites have become a very commonly used feature. Flashing contents are instrumental in helping certain content stand out from the rest. But you have to make sure that the content doesn’t flash more than 3 times every second as it might cause seizures. Moving content and carousel content shouldn’t be too rapid that it becomes incomprehensible for your users. Similar to the media controls, the user must also be able to control the moving content to prevent the features from becoming a distraction.
Text Size and Contrast ratio
It is always a good idea to keep your text size fairly big as content with small text sizes rarely works. Even if you keep the text size big enough and fail to use proper text and background colors, the text will become hard to read. You should also test it from the perspective of a person with color blindness to see there are no contrast issues. There is even a tool called the Color Contrast Analyzer that you could use to check if the contrast ratio will pass the required standards. Few people will be able to read the content only when the text is enlarged beyond the regular size. So make sure there is enough spacing in places you add the text and not cram in too much content. Keep it simple, yet catchy.
Keyboard access
We have added this factor to our Website Accessibility Testing Checklist as it is one of the most overlooked aspects. Not everybody will be able to navigate through your website using a mouse. So make sure it is possible to navigate to the different elements like drop-down lists, text fields, menus, and so on. The labels used for text boxes should convey the requirement and be on the left side of the box for left-to-right languages. Make sure to highlight mandatory fields with the asterisks (*) sign and not just color to differentiate it.
Why is Accessibility Testing Mandatory?
So this is a basic Website Accessibility Testing Checklist that you can concentrate on, to begin with. But they are in no way sufficient to get a proper standardization as your website might pass all these checks and still have major accessibility issues. If your website isn’t accessible, there are possibilities of getting sued based on the part of the world you are in. Why go through all the hassle and be at risk when you can simply outsource the web accessibility testing to one of the best web accessibility testing service providers like us? Making your product accessible is no longer a choice you can ignore as it is an important part of making your product available to a wider audience and enhancing the product’s overall usability.
by admin | Dec 21, 2021 | Automation Testing, Blog, Latest Post |
In today’s world, success is heavily dependent on the pace at which we work. So automating repetitive work is one of the quickest ways to attain functional performance. But if you find automation to be daunting, you might have a negative approach of just manually doing the tasks over and over again to enter an endless loop of wasting time. So if you are someone who uses Google Sheets regularly to create and maintain data, this blog will be a lifesaver for you. As a leading automation testing services company, we are focused on dedicating our time to our core service by automating repetitive tasks. So in this blog, we will be exploring how to achieve Google Sheet Automation and get the job done in no time. Without any further ado, let’s get started.
The pace isn’t the only advantage that comes with automation. Since repetitive tasks are prone to oversight and manual errors, we will be able to avoid such issues by implementing automation. Now that we have established what we are targeting to achieve, let’s first see how to do it. We will be making use of the available Google APIs to examine and add data in Google Sheets using Python. So you wouldn’t have to spend hours of your time extracting data and then replica-pasting it to other spreadsheets.
Prerequisites:
In order to achieve Google Sheet Automation, you’ll be needing a few prerequisites such as
- A Google account.
- A Google Cloud Platform project with the API enabled.
- The pip package management tool
- Python 2.6 or greater
How to Achieve Google Sheet Automation using Google API Services?
Here are the few steps that need to be followed to start using the Google sheets API.
i. Create a project on Google Cloud console
ii. Activate the Google Drive API
iii. Create credentials for the Google Drive API
iv. Activate the Google Sheets API
v. Install a few modules with pip
vi. Open the downloaded JSON file and get the client email
vii. Share the desired sheet with that email
viii. Connect to Google Sheet using the Python code
Create a project on Google cloud console
In order to read and update the data from Google Sheets in Python, we will have to create a Service Account. The reason behind this need is that it is a special form of account that can be used to make authorized API calls to Google Cloud Services. Almost everybody has a Google account today. In case you don’t, make sure to create one and then follow all the steps and comply with the requirements to create a Google Services account.
1. You will be able to create a new project by going to the developer’s console and clicking on the ‘New Project’ button.
2. You can then assign the project name and even enter the organization name if you prefer to. Once you are done, click on the ‘Create’ button.
3. The next step after creating the project would be to enable the APIs that we require in this it. To access the different API options provided by Google, you have to click on Menu -> APIs & Services -> Library.
4. You have to search and enable the following two APIs from the library as shown below. You can enable them by just clicking on the enable button that appears.
- Google Sheets API
-
- Google Drive API
The Google Sheets API is the important one that will enable you to read and regulate the data in Google Sheets.
5. Now that you have enabled the required APIs to beat your automation challenge, it’s time to create the credentials for the services account. You can do that by clicking the ‘Create Credentials’ button that can be found in the Credentials menu as shown in the image.
6. Once you click on that, a drop-down list will appear. Choose the ‘Service Account’ option from the list.
7. You would have to provide the Service Account details here in order to continue. That is why we had mentioned that you would have to create one prior to starting this process. Once you have provided the info, you can create the credentials by clicking on the ‘Create and Continue’ option.
8. Similar to how we share the Google spreadsheets with other collaborators by providing them various access permissions like edit or view only, we will have to provide access to our service account as well. Since we have to both read and write in the spreadsheets, you would have to give editing access or not the view-only option.
9. Once the credentials have been created, download the JSON file for the credentials. The JSON file will contain the keys that you will need to access the API. So our Google Service account is now ready to use.
Share the desired sheet with that email
Now that the Services account credentials have been created, you have to provide the email using which you will access the spreadsheet.
Open the Google Sheet that you want to automate and click on the Share button to provide access to this client email. Now, you are all set to code and access the sheet using Python.
Connect to Google Sheet using Python Code
First up, you have to open the downloaded JSON file in PyCharm. You can then create a Python file in the same project folder and start writing your script.
We then have to install two packages (gspread and oauth2client) from PIP. To do that in PyCharm, we have to open command prompt and use the below command
pip install gspread oauth2client
Now let’s take a look at the different segments of the python code one by one to understand it easily and successfully implement it to achieve Google Sheet Automation.
1. Importing the Libraries
We will need both the gspread and oauth2client services to authorize and make API calls to Google Cloud Services.
import gspread
from oauth2client.service_account import ServiceAccountCredentials
from pprint import print
2. Define the scope of the application
Then, we will define the scope of the application and add the JSON file that has the credentials to access the API.
scope = ["https://spreadsheets.google.com/feeds",'https://www.googleapis.com/auth/spreadsheets',"https://www.googleapis.com/auth/drive.file",
"https://www.googleapis.com/auth/drive"]
3. Add credentials to the account
Once the scope has been defined, you have to add the credentials to the account.
creds = ServiceAccountCredentials.from_json_keyfile_name("test1-331506-a11c2c0a84fc.json", scope)
4. Authorize the client sheet
The next stage is authorizing the client sheet.
client = gspread.authorize(creds)
5. To open a Google Sheet
There is nothing that can be done without opening the Google Sheet in the first place.
sheet = client.open("Automation").sheet1
6. Get all records
Once the sheet is open, you can get all the data present in the sheet using the get_all_records function. It will return a JSON string that contains the data.
data = sheet.get_all_records()
pprint(data)
7. To get a specific row
Though reading all the data is a great feature, that wouldn’t be needed every single. So this is the code that you can use to get data from a specific row.
row = sheet.row_values(3) # Get a specific row
pprint(row)
8. To get a specific Column
Similarly, we will also be able to access data from a specific column.
col = sheet.col_values(2) # Get a specific column
pprint(col)
9. To Get the value of a specific cell
We can even be very precise and access data from a specific cell too.
cell = sheet.cell(1,2).value # Get the value of a specific cell
pprint(cell)
10. To insert the data into a sheet
We have seen how to read the data, now let’s see how we can insert data.
insertRow = [ 15, "Logesh"]
sheet.insert_row(insertRow, 15)
11. To delete certain row
Not all data in a sheet will be needed forever and so you can even delete a row of data from your sheet.
12. To update one cell
If at all you want to change the data in an existing cell, you wouldn’t have to delete the content and then add the new one again. Instead, you can just update the content in the cell.
sheet.update_cell(2,4, "CHANGED") # Update one cell
13. To Get the number of rows in the sheet
Beyond reading and editing the content in the sheet, you can even get to know the number of rows in a sheet as it might be needed for your automation process.
numRows = sheet.row_count # Get the number of rows in the s
pprint(numRows)
14. To get the length of the data
Likewise, we can even get the length of the data in the sheet if you want to use that in your automation as well.
Source Code:
Since we have explained everything part by part, now it’ll be much easier for you to go through the source code and understand it clearly.
import gspread
from oauth2client.service_account import ServiceAccountCredentials
from pprint import pprint
scope = ["https://spreadsheets.google.com/feeds",'https://www.googleapis.com/auth/spreadsheets',"https://www.googleapis.com/auth/drive.file",
"https://www.googleapis.com/auth/drive"]
creds = ServiceAccountCredentials.from_json_keyfile_name("test1-331506-a11c2c0a84fc.json", scope)
client = gspread.authorize(creds)
sheet = client.open("Automation").sheet1
data = sheet.get_all_records()
pprint(data)
row = sheet.row_values(3) # Get a specific row
pprint(row)
col = sheet.col_values(2) # Get a specific column
pprint(col)
cell = sheet.cell(1,2).value # Get the value of a specific cell
pprint(cell)
insertRow = [ 15, "Logesh"]
sheet.insert_row(insertRow, 15) # Insert the list as a row at index 4 its will over write
sheet.delete_rows(14)
sheet.update_cell(2,4, "CHANGED") # Update one cell
numRows = sheet.row_count # Get the number of rows in the sheet
pprint(numRows)
pprint(len(data))
Conclusion:
We hope you now have a clear idea of how to achieve google sheet automation as per your needs and make the most out of the tool to save your valuable time. As a test automation services provider, we understand that not everything can be automated, but if you approach any automation task with a negative mindset, you’ll never be able to unravel the solutions to overcome your obstacles. So follow and implement these methods with a positive mindset and you will definitely witness performance improvement at your end.