Accessibility in the context of a software application means that as many people as possible can use the application easily. When making an application accessible, we should consider users with limited vision or hearing, limited cognitive ability, and limited dexterity. Accessibility also means that users from all over the world can use the application, even if their language is different from that of the developers who created it.
In this final post in my "Easy Free Automation" series, I'll be showing two easy ways to test for accessibility. I'll be using Python and Selenium Webdriver. You can download the simple test here.
To run the test, you will need to have Python and Selenium installed. You can find instructions for installing Python in Easy Free Automation Part I: Unit Tests. To install Selenium, open a command window and type pip install selenium. You may also need to have Chromedriver installed. You can find instructions for installing it here.
Once you have downloaded the test file and installed all the needed components, navigate to the test folder in the command line and type python3 easyFreeAccessibilityTest.py. (If you don't have Python 3, or if you don't have two versions of Python installed, you may be able to type python instead of python3.) The test should run, the Chrome browser should open and close when the test is completed, and in the command line you should see these two log entries:
Alt text is present
Page is in German
Let's take a look at these two tests to see what they do. The first test verifies that an image has an alt text. Alt texts are used to provide a description of an image for any user who might not be able to see the image. A screen-reading application will read the alt text aloud so the user will know what image is portrayed.
driver.get("https://www.amazon.com/s?k=goodnight+moon&ref=nb_sb_noss_1")
elem = driver.find_element_by_class_name("s-image")
val = elem.get_attribute('alt')
if val == 'Goodnight Moon':
print('Alt text is present')
else:
print('Alt text is missing or incorrect')
In the first line, we are navigating to an Amazon.com web page where we are searching for the children's book "Goodnight Moon". In the next line, we are locating the book image. In the third line, we are getting the 'alt' attribute of the web element and assigning it to the variable 'val'. If there is no alt text, this variable will remain null.
Finally we are using an if statement to assert that the alt text is correct. If the alt text is not the title of the book, we will get a message that the text is missing.
The second test verifies that we are able to change the language of the Audi website to German.
driver.get("https://www.audi.com/en.html")
driver.find_element_by_link_text("DE").click()
try:
elem = driver.find_element_by_link_text("Kontakt")
if elem:
print('Page is in German')
except:
print('Page is not in German')
In the first line, we navigate to the Audi website. In the second line, we find the button that will change the language to German, and we click it. Then we look for the element with the link text of "Kontakt". If we find the element, we can conclude that we are on the German version of the page. If we do not find the element, the page has not been changed to German. The reason I am using a try-except block here is that if the element with the link text is not located, an error will be thrown. I'm catching the error so that an appropriate error message can be logged and the test can end properly.
There are other ways to verify things like alt texts and page translations. There are CSS scanning tools that will verify the presence of alt texts and rate how well a page can be read by a screen reader. There are services that will check your internationalization of your site with native speakers of many different languages. But if you are looking for an easy, free way to check these things, this simple test script provides you with a way to get started.
For the last eight weeks, we've looked at easy, free ways to automate each area of the Automation Test Wheel. I hope you have found these posts informative! If you missed any of the posts, I hope you'll go back and take a look. Remember also that each week has a code sample that can be found at my Github page. Happy automating!
Email Subscription Form
Subscribe to:
Post Comments (Atom)
New Blog Location!
I've moved! I've really enjoyed using Blogger for my blog, but it didn't integrate with my website in the way I wanted. So I...
-
It's never fun to start your work day and discover that some or all of your nightly automated tests failed. It's especially frustra...
-
It's book review time once again, and this month I read Unit Testing Principles, Practices, and Patterns by Vladimir Khorikov. I thoug...
-
I've moved! I've really enjoyed using Blogger for my blog, but it didn't integrate with my website in the way I wanted. So I...
This comment has been removed by a blog administrator.
ReplyDeleteThanks you for sharing the article. The data that you provided in the blog is infromative and effectve.
ReplyDeleteSoftware testing training in mumbai
Manual testing training in mumbai
Automation testing training in mumbai
ISTQB training in mumbai
Needed to compose one simple thing yet thanks for the suggestions that you are contributed here. Would like to read this blog regularly to get more updates regarding Software Testing Company in India and Automation Testing Services
ReplyDeleteThanks for the article. Really appreciate the time and effort that went into composing this article. Looking forward to reading more from you.
ReplyDeletesoftwaretesting
softwaretestingcompaniesinhyderabad
manualtesting
automationtesting
Thank your for this article. We are proving software testing services in Hyderabad. https://stigentech.com/qa_testing/
ReplyDeleteNice Post...
ReplyDeleteI am a professional techie and using a computer system for various computing tasks. I need a Microsoft office suite for various tasks such as MS word, and Excel. I want to install MS office suite from www.office.com/setup on my computer system, but I don’t have sufficient experience to install MS office suite on my computer system. So, I am into a big technical trouble, so I am looking for a technician’s help for the installation process. Can you recommend the easy steps for the installation process of MS office suite? Please share your easy steps here.
office.com/setup
office.com
https://penzu.com/p/3d2eeea4
ReplyDeleteI agree with you. I was looking for some cross-references, and found this one. I really think that I found something worth reading. I am putting it on my RSS feed to ensure that I don't miss out on your posts.
ReplyDeleteEtech
Sorry, No Manipulations With Clipboard Allowed
VIPBox
TheWatchSeries.to
retrieve software product keys
Enable Streamer Mode on Discord
Minecraft run faster
I have been reading your posts for quite some time. And everytime, it adds to my knowledge. But could you please elaborate on the last section in your upcoming post? Keep writing.
ReplyDeletetech ransom
Gorgeous Rainmeter Skins
Google Picasa Alternatives
[pii_email_ddb7b0ca0f8cb4d23f14]
Best Windows 10 Apps
8 Best Voice Changer Apps for Discord
Cool Discord Bots
SNES Emulators
siberian husky puppies for sale near me
ReplyDeleteminiature Siberian Husky puppies
Siberian Husky puppies for adoption
white Siberian Husky puppies for sale near me
white Siberian Husky puppies
Thank you, I have recently been looking for info about this topic for ages and yours is the best I have discovered so far.
ReplyDeleteBut, what about the bottom line? Are you sure about the source?우리카지노
토토사이트
ReplyDeleteI’ve been watching out for your content. If ever you have some more updates please do notify me.
먹튀검증
ReplyDeleteI am very happy to discover your post as it will become on top in my collection of favorite blogs to visit.
You have remarked very interesting details ! Also visit my site:
ReplyDelete토토
경마사이트
경마
Succeed! It could be one of the most useful blogs we have ever come across on the subject. Excellent info! I’m also an expert in this topic so I can understand your effort very well. Thanks for the huge help. 안전놀이터
ReplyDeleteThank you so much for such a well-written article. It’s full of insightful information. Your point of view is the best among many without fail.For certain, It is one of the best blogs in my opinion. 먹튀검증
ReplyDeleteThat's a great article! The neatly organized content is good to see. Can I quote a blog and write it on my blog? My blog has a variety of communities including these articles. Would you like to visit me later? keo nhacai
ReplyDeleteTo do this from placing completely different signs in the office and bathing room to entice and call attention workers to fix and sterilize their wrists and hands regularly with a alcohol-based sanitiserAfter disinfection from a surface, have a disinfecting wipe for you to do a one-way wipe down. Which may be, a wipe down in only one place, that process germ won’t turn out to be deposited in your opposite direction of this surface. cleaning companies in dubai
ReplyDeleteThanks for sharing.
ReplyDeletetest automation best practices
test automation best practices
test automation best practices
test automation best practices
ReplyDeletetest automation best practices
test automation best practices
test automation best practices
ReplyDeletetest automation best practices
roi test automation
roi test automation
ReplyDeleteroi test automation
roi test automation
roi test automation
roi test automation
ReplyDeleteroi test automation
roi test automation
roi test automation
roi test automation
Very garcefull post thanks for sharing. If you are looking for Courses after 12th, then you must visit India's largest growing education platform, Spin On Education which provides the best entrance exam preparation material and counselling.
ReplyDeleteThis post is so useful and informative. Keep updating with more information.....
ReplyDeleteDeveloper Testing
Software System Testing
By this comment I sincerely believe that the site needs more attention.Thank you once again for your advice. I will read more!
ReplyDelete카지노
메이저사이트
토토
사설토토
스포츠토토
카지노사이트
Gday there, just got alert to your web page through Search engine, and found that it is pretty beneficial. I will value if you decide to retain such.
ReplyDeleteKeep working ,splendid job!카지노사이트
Write more, that all I have to say. Literally, it seems as though you relied on the video to make your point. You obviously know what your talking about, why waste your intelligence on just posting videos to your site when you could be giving us something informative to read?바둑이사이트
ReplyDeleteGreat share! Keep posting!
ReplyDeleteبالجبيل
This comment has been removed by the author.
ReplyDeleteThanks to sharing this infromation help me lot sir
ReplyDeleteRead more: https://fmovies3.com/
Unlock a world of entertainment possibilities with Fubo.tv/connect, where live sports, TV channels, and on-demand content converge. Immerse yourself in the excitement of live games, explore an extensive selection of channels spanning news, entertainment, and more, and discover a vast library of on-demand movies, series, and exclusive content, all available at your fingertips.
ReplyDeleteCbd Oil For Pain has gained popularity as a potential remedy for pain management. Extracted from the hemp plant, CBD oil contains cannabidiol, a non-psychoactive compound with anti-inflammatory properties. When consumed, CBD interacts with the body's endocannabinoid system, which regulates various functions, including pain perception.
ReplyDeleteElevate your career with our premium CV writing services Ireland! Our expert team at CVWritingServices.ie is dedicated to crafting resumes that showcase your skills and experience. Trust us for the most reliable and best CV writing service in Ireland. Don't miss out on your dream job – start with us today!
ReplyDeleteNice blog
ReplyDeleteLooking for online driver licence translation services? Mytranslationservices.com is your trusted destination. Our offerings include marketing translation, legal translation, document translation, and transcription services, covering over 200 languages. With precision and cultural sensitivity, we ensure accurate translations for your driver's license. Count on us for professional online translation services tailored to your needs. Explore Mytranslationservices.com for comprehensive language solutions. When it comes to online driver's license translation, we're your reliable choice. Visit our website now for seamless and accurate translations. Your partner for online driver's license translation is Mytranslationservices.com.
In a world where technology dominates our expressions of affection, there's a unique joy in creating tangible symbols of love. One such delightful and nostalgic craft involves transforming a simple gum wrapper into a charming heart. This DIY project not only allows you to express your creativity but also provides a unique and personal way to show someone you care. In this comprehensive guide, we'll explore the step-by-step process of crafting hearts with gum wrappers, turning a humble foil into a symbol of love and thoughtfulness. How to Make a Heart with a Gum Wrapper
ReplyDeleteNice Post,
ReplyDeleteHello everyone, I am George Mcbrine your helping partner in crafting your CV. Crafting a professional CV just got easier with our premier CV Builder in Ireland. Our intuitive platform guides you through the process step-by-step, helping you create a polished and tailored resume in no time. With customizable templates and expert tips, you can showcase your skills and experiences effectively to potential employers. Say goodbye to CV struggles and hello to success with our CV Builder in Ireland. Start building your winning CV today!