5 Courses to Learn Selenium WebDriver for Automation Testing in Java

The days of manual testing are limited as more and more companies are shifting towards automation testing. This means all manual testing QAs needs to learn new test automation skills through Selenium, Cucumber, JUnit, and TestNG to give their career a boost. If you are manual testers or non-programming testers interested in learning test automation, or a freshers/graduates who want to kick-start their career in automating testing then you have come to the right place. In this article, I am going to share some of the best courses to learn Selenium Webdriver with Java and other automation testing technology like JUnit, Cucumber, and more.

Today's software development world uses TDD (Test-Driven Development) and BDD (Business-Driven Development) practices and requires continuous integration and continuous deployment using Jenkins and Maven.

Quick Start Guide to SonarQube for Static Code Analysis

SonarQube Installation and Configuration

Installation Prerequisites

The following are the essential requirements to get started with SonarQube.

  • RAM with at least 2 GB
  • Disk Space – Depends on how much code you analyze with SonarQube

Note: For enterprise-grade SonarQube versions additional hardware is needed.

12 Vital Tips and Tools to Combat Comment Spam in WordPress

Are you getting tired of dealing with comment spam on your WordPress blog? Well, you are not alone.

Spam comments are a huge problem especially if you are not prepared to deal with them properly.

In this article, we’ll share the best WordPress comment spam plugins and helpful tips to combat spam comments in WordPress. These tips will save you a lot of time and will significantly eliminate comment spam from your website.

Combat WordPress comment spam with these tips and tools

Why You Need to Deal with Comment Spam in WordPress?

Internet is full of spam bots that automatically spread links for nefarious websites in the form of comment spam. The purpose of these spam comments is to get ranked in search engines and also to get accidental clicks from unsuspecting visitors.

But not all comment spam is submitted by bots. There are actual human submitted spam comments as well. These off-topic and poorly written comments are harder to catch and often contain links to third-party websites.

If you are not monitoring your website and these comments get published, then both your actual users and search engines will be able to see them.

This affects your website’s reputation. Users would consider your website to be a low quality or spam website.

Search engines can also mark your website as unsafe if they found links to websites that distribute malware and viruses.

That being said, let’s see how you can combat comment spam effectively, so that you spend less time worrying about spam and more time on growing your online business.

1. Turn on Comment Moderation in WordPress

Let’s first make sure that no comment on your website is published without your approval. This step will ensure that comments don’t bypass any filters, and it will also give you full control on which comments appear on your website.

This solution is highly recommended for business websites such as law firms, accounting, etc.

Head over to the Settings » Discussion page inside WordPress admin area. Next, scroll down to the ‘Before a comment appears’ section and check the box next to ‘Comment must be manually approved’ option.

Enable comment moderation in WordPress

Don’t forget to click on the ‘Save changes’ button to store your settings.

All your WordPress comments will now be held for moderation and you will have to manually approve each comment before it appears on your website.

Now you may be wondering how would I go through all the comments? Well in the next few tips, we will show you how to eliminate spam comments so that you only have to go through genuine comments.

2. Activate Akismet Anti-spam Protection

Akismet anti-spam protection

Akismet is an anti-spam plugin that comes pre-installed with WordPress. It filters all WordPress comments on your website through their anti-spam database and catches the most common types of spam comments.

Akismet is available as a free plugin, but you’ll need to signup for their API key. You can get it free for a personal blog or a small website.

To set it up, see our guide on how to set up Akismet for beginners with step by step instructions.

3. Using Sucuri to Combat Spam Comments

Sucuri website firewall

While Akismet is able to catch a lot of spam comments, it cannot stop spammers from accessing your website. Too many requests from spammers to submit comments can slow down your website and affect performance.

This is where Sucuri comes in. It is the best WordPress firewall plugin that allows you to block suspicious requests before they even reach your website.

They can prevent automated bots and scripts from submitting comments. This reduces the load on your servers and the number of spam comments you receive.

4. Using Honeypot to Catch Spam Bots

Honeypot anti spam technique

Honeypot technology is an effective method to trick spambots into identifying themselves. Once they are identified their comments can be blocked.

First, you need to install and activate the Antispam Bee plugin. Upon activation simply go to Settings » Antispam Bee page and check the option to mark as spam for all honeypot caught comments.

Don’t forget to click on the save changes button to store your settings.

The plugin will now use the honeypot technique to catch the bad spam bots. It also has other antispam filter such as validate the IP address from your WordPress comment blacklist, look at bbcode, look in local spam database, and more.

5. Add Google reCAPTCHA Verification

Using reCAPTCHA in WP Comments plugin, you can enable Google reCAPTCHA challenge on your comment forms.

WordPress comment form with reCAPTCHA enabled

ReCAPTCHA is an advanced form of CAPTCHA, which is a technology used to differentiate between robots and human users. CAPTCHA is an acronym for “Completely Automated Public Turing test to tell Computers and Humans Apart”.

Google makes it easy for users to verify their identity by simply clicking on the checkbox button.

For spambots, this technology is quite hard to bypass because when Google detects a spam bot, it gives them a much harder challenge.

See our guide on how to how to add reCAPTCHA to WordPress comments.

Note: while most WordPress comment captcha plugins are annoying, this is the best form of CAPTCHA you can use.

6. Removing Website URL Field from Comment Form

Remove website field from the comment form

The URL field in the comment form attracts not only spammers (both automated and human), but it also invites people who have absolutely no interest in the discussion at all.

These comments usually contain a line or two of irrelevant nonsense, and the comment author name will contain a keyword or a combination of a real name with keywords like Sally from Dunder Mifflin, or John @SEOconsultants, etc.

Simply add the following code to your WordPress theme’s functions.php file or a site-specific plugin.


function wpb_disable_comment_url($fields) { 
unset($fields['url']);
return $fields;
}
add_filter('comment_form_default_fields','wpb_disable_comment_url');

This code simply filters the WordPress comment form fields and removes the website field from the form.

Note: you will need to login to your WordPress hosting via FTP to upload the code above.

7. Disable Comments on Media Attachments

WordPress automatically creates image attachment pages where users can see an image and even leave a comment on it.

If you are linking your images to the attachment page, then after a while you will have a lot of attachment pages with comments enabled on them.

If images are a central part of your content, then that’s fine. But if you don’t want users to comment on images, then you should turn off comments on media attachments.

The easiest way to do this is by installing the Disable Comments plugin. Upon activation, go to Settings » Disable Comments page and check the box next to ‘Media’ option.

Disable comments for attachments

Click on the save changes button to store your settings. The plugin will now disable comments on your WordPress media files and attachments.

8. Disable HTML in Comments

Disable HTML in WordPress comments

Another handy tip to discourage links in comments is disabling HTML in comments. HTML can be used to hide spam links in WordPress comments.

Simply add the following code to your theme’s functions.php file or a site-specific plugin.

    function wpb_comment_post( $incoming_comment ) {
    $incoming_comment['comment_content'] = htmlspecialchars($incoming_comment['comment_content']);
    $incoming_comment['comment_content'] = str_replace( "'", ''', $incoming_comment['comment_content'] );
	return( $incoming_comment );
    }
    function wpb_comment_display( $comment_to_display ) {
     $comment_to_display = str_replace( ''', "'", $comment_to_display );
     return $comment_to_display;
}
add_filter( 'preprocess_comment', 'wpb_comment_post', '', 1);
add_filter( 'comment_text', 'wpb_comment_display', '', 1);
add_filter( 'comment_text_rss', 'wpb_comment_display', '', 1);
add_filter( 'comment_excerpt', 'wpb_comment_display', '', 1);
remove_filter( 'comment_text', 'make_clickable', 9 );

This code changes HTML code into HTML entities which are displayed as the code and are not parsed by the browser.

9. Minimum and Maximum Comment Length

Another way to combat comment spam is by using Yoast Comment Hacks plugin to set a minimum and maximum comment length.

Recently we ran into a comment spam problem where a spammer was leaving hundreds of comments per hour with a single word: hello.

Akismet and Sucuri were not able to block this because the comment looked natural. Antispam bee honeypot slowed the spammer down, but it too wasn’t able to entirely block the attack.

We simply enabled the Yoast Comment Hacks plugin and set the minimum comment length. This forces the user to leave a more meaningful comment instead of just a one word message.

10. Disable Trackbacks in WordPress

A big portion of comment SPAM is trackbacks. For most blogs, it is not necessary to have trackbacks enabled. You can choose to disable trackbacks on your entire blog or in an individual post. This is an easy way to significantly reduce comment SPAM.

Disable trackbacks in WordPress

You can find the above option by visiting Settings » Discussion. This will turn off trackbacks for your entire site.

11. Turn off Comments on Old Posts

WordPress allows you to turn off comments on old posts. This particularly helpful for websites publishing content that is more timely like news or events websites.

Simply go to Settings » Discussion, under ‘Other comment settings’ you will see the option ‘Automatically close comments on articles older than’. Check the box next to this option and enter the number of days you want comments to be displayed on a post.

Close comments on older articles

WordPress will now automatically close comments on posts older than the number of days you defined for this option. If you need, you can override comment deadline in WordPress for individual posts where you would like comments to remain open.

12. Switch Off Comments

In case you feel that you don’t need comments on your WordPress site, or comment moderation goes out of your hands, remember that you can always switch off comments in WordPress. All you have to do is go to Settings » Discussion and uncheck the box next to ‘Allow people to post comments on new articles’.

Turn off comments

You can also make comments for registered users only by checking the box in your Settings ~ Discussion page. For more details, see our guide on how to completely disable comments in WordPress.

Frequently Asked Questions by Users

Why are they spamming me?

Spammers want to get better search rankings or lure unsuspecting visitors to dubious and malicious sites. They think that by spamming they can get more links, and it will somehow positively affect their search rankings.

In most cases, it is not a personal attack against you rather it’s a systematic process that targets many blogs.

What happens to comments that are marked as “Spam”?

The comments that you mark as spam, are not displayed on your website. You can delete Spammed comments in batch and/or recover good comments from the SPAM list.

Spam comments

Why is every comment going into the moderation queue?

You enabled the comment moderation as the first tip in this article. This gives you absolute control on any comment that gets published on your website.

We hope this article helped you find useful tips and tools to combat comment spam in WordPress. You may also want to see our guide on how to grow your website traffic and convert users into subscribers by creating an email newsletter.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post 12 Vital Tips and Tools to Combat Comment Spam in WordPress appeared first on WPBeginner.

Web Accessibility In Context

Web Accessibility In Context

Web Accessibility In Context

Be Birchall

Haben Girma, disability rights advocate and Harvard Law’s first deafblind graduate, made the following statement in her keynote address at the AccessU digital accessibility conference last month:

“I define disability as an opportunity for innovation.”

She charmed and impressed the audience, telling us about learning sign language by touch, learning to surf, and about the keyboard-to-braille communication system that she used to take questions after her talk.

Contrast this with the perspective many of us take building apps: web accessibility is treated as an afterthought, a confusing collection of rules that the team might look into for version two. If that sounds familiar (and you’re a developer, designer or product manager), this article is for you.

I hope to shift your perspective closer to Haben Girma’s by showing how web accessibility fits into the broader areas of technology, disability, and design. We’ll see how designing for different sets of abilities leads to insight and innovation. I’ll also shed some light on how the history of browsers and HTML is intertwined with the history of assistive technology.

Assistive Technology

An accessible product is one that is usable by all, and assistive technology is a general term for devices or techniques that can aid access, typically when a disability would otherwise preclude it. For example, captions give deaf and hard of hearing people access to video, but things get more interesting when we ask what counts as a disability.

On the ‘social model’ definition of disability adopted by the World Health Organization, a disability is not an intrinsic property of an individual, but a mismatch between the individual’s abilities and environment. Whether something counts as a ‘disability’ or an ‘assistive technology’, doesn’t have such a clear boundary and is contextual.

Addressing mismatches between ability and environment has lead to not only technological innovations but also to new understandings of how humans perceive and interact with the world.

Access + Ability, a recent exhibit at the Cooper Hewitt Smithsonian design museum in New York, showcased some recent assistive technology prototypes and products. I’d come to the museum to see a large exhibit on designing for the senses, and ended up finding that this smaller exhibit offered even more insight into the senses by its focus on cross-sensory interfaces.

Seeing is done with the brain, and not with the eyes. This is the idea behind one of the items in the exhibit, Brainport, a device for those who are blind or have low vision. Your representation of your physical environment from sight is based on interpretations your brain makes from the inputs that your eyes receive.

What if your brain received the information your eyes typically receive through another sense? A camera attached to Brainport’s headset receives visual inputs which are translated into a pixel-like grid pattern of gentle shocks perceived as “bubbles” on the wearer’s tongue. Users report being able to “see” their surroundings in their mind’s eye.

The Brainport is a camera attached to the forehead connected to a rectangular device that comes in contact with the wearer’s tongue.
Brainport turns images from a camera into a pixel-like pattern of gentle electric shocks on the tongue. (Image Credit: Cooper Hewitt)(Large preview)

Soundshirt also translates inputs typically perceived by one sense to inputs that can be perceived by another. This wearable tech is a shirt with varied sound sensors and subtle vibrations corresponding to different instruments in an orchestra, enabling a tactile enjoyment of a symphony. Also on display for interpreting sound was an empathetically designed hearing aid that looks like a piece of jewelry instead of a clunky medical device.

Designing for different sets of abilities often leads to innovations that turn out to be useful for people and settings beyond their intended usage. Curb cuts, the now familiar mini ramps on the corners of sidewalks useful to anyone wheeling anything down the sidewalk, originated from disability rights activism in the ’70s to make sidewalks wheelchair accessible. Pellegrino Turri invented the early typewriter in the early 1800s to help his blind friend write legibly, and the first commercially available typewriter, the Hansen Writing Ball, was created by the principal of Copenhagen’s Royal Institute for the Deaf-Mutes.

Vint Cerf cites his hearing loss as shaping his interest in networked electronic mail and the TCP/IP protocol he co-invented. Smartphone color contrast settings for color blind people are useful for anyone trying to read a screen in bright sunlight, and have even found an unexpected use in helping people to be less addicted to their phones.

The Hansen Writing Ball has brass colored keys arranged as if on the top half of a ball, with a curved sheet of paper resting under them.
The Hansen Writing Ball was developed by the principal of Copenhagen’s Royal Institute for the Deaf-Mutes. (Image Credit: Wikimedia Commons) (Large preview)

So, designing for different sets of abilities gives us new insights into how we perceive and interact with the environment, and leads to innovations that make for a blurry boundary between assistive technology and technology generally.

With that in mind, let’s turn to the web.

Assistive Tech And The Web

The web was intended as accessible to all from the start. A quote you’ll run into a lot if you start reading about web accessibility is:

“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”

— Tim Berners-Lee, W3C Director and inventor of the World Wide Web

What sort of assistive technologies are available to perceive and interact with the web? You may have heard of or used a screen reader that reads out what’s on the screen. There are also braille displays for web pages, and alternative input devices like an eye tracker I got to try out at the Access + Ability exhibit.

It’s fascinating to learn that web pages are displayed in braille; the web pages we create may be represented in 3D! Braille displays are usually made of pins that are raised and lowered as they “translate” each small part of the page, much like the device I saw Haben Girma use to read audience questions after her AccessU keynote. A newer company, Blitab (named for “blind” + “tablet”), is creating a braille Android tablet that uses a liquid to alter the texture of its screen.

Haben Girma sits at a conference table and uses her braille reader.
Haben Girma uses her braille reader to have a conversation with AccessU conference participants. (Photo used with her permission.) (Large preview)

People proficient with using audio screen readers get used to faster speech and can adjust playback to an impressive rate (as well as saving battery life by turning off the screen). This makes the screen reader seem like an equally useful alternative mode of interacting with web sites, and indeed many people take advantage of audio web capabilities to dictate or hear content. An interface intended for some becomes more broadly used.

Web accessibility is about more than screen readers, however, we’ll focus on them here because — as we’ll see — screen readers are central to the technical challenges of an accessible web.

Recommended reading: Designing For Accessibility And Inclusion by Steven Lambert

Technical Challenges And Early Approaches

Imagine you had to design a screen reader. If you’re like me before I learned more about assistive tech, you might start by imagining an audiobook version of a web page, thinking your task is to automate reading the words on the page. But look at this page. Notice how much you use visual cues from layout and design to tell you what its parts are for how to interact with them.

  • How would your screen reader know when the text on this page belongs to clickable links or buttons?
  • How would the screen reader determine what order to read out the text on the page?
  • How could it let the user “skim” this page to determine the titles of the main sections of this article?

The earliest screen readers were as simple as the audiobook I first imagined, as they dealt with only text-based interfaces. These “talking terminals,” developed in the mid-’80s, translated ASCII characters in the terminal’s display buffer to an audio output. But graphical user interfaces (or GUI’s) soon became common. “Making the GUI Talk,” a 1991 BYTE magazine article, gives a glimpse into the state of screen readers at a moment when the new prevalence of screens with essentially visual content made screen readers a technical challenge, while the freshly passed Americans with Disabilities Act highlighted their necessity.

OutSpoken, discussed in the BYTE article, was one of the first commercially available screen readers for GUI’s. OutSpoken worked by intercepting operating system level graphics commands to build up an offscreen model, a database representation of what is in each part of the screen. It used heuristics to interpret graphics commands, for instance, to guess that a button is drawn or that an icon is associated with nearby text. As a user moves a mouse pointer around on the screen, the screen reader reads out information from the offscreen model about the part of the screen corresponding to the cursor’s location.

Graphics commands build a GUI from code. Graphics commands are also used to build a database representation of the screen, which can then be used by screen readers.
The offscreen model is a database representation of the screen based on intercepting graphics commands. (Large preview)

This early approach was difficult: intercepting low-level graphics commands is complex and operating system dependent, and relying on heuristics to interpret these commands is error-prone.

The Semantic Web And Accessibility APIs

A new approach to screen readers arose in the late ’90s, based on the idea of the semantic web. Berners-Lee wrote of his dream for a semantic web in his 1999 book Weaving the Web: The Original Design and Ultimate Destiny of the World Wide Web:

I have a dream for the Web [in which computers] become capable of analyzing all the data on the Web — the content, links, and transactions between people and computers. A "Semantic Web", which makes this possible, has yet to emerge, but when it does, the day-to-day mechanisms of trade, bureaucracy, and our daily lives will be handled by machines talking to machines. The "intelligent agents" people have touted for ages will finally materialize.

Berners-Lee defined the semantic web as “a web of data that can be processed directly and indirectly by machines.” It’s debatable how much this dream has been realized, and many now think of it as unrealistic. However, we can see the way assistive technologies for the web work today as a part of this dream that did pan out.

Berners-Lee emphasized accessibility for the web from the start when founding the W3C, the web’s international standards group, in 1994. In a 1996 newsletter to the W3C’s Web Accessibility Initiative, he wrote:

The emergence of the World Wide Web has made it possible for individuals with appropriate computer and telecommunications equipment to interact as never before. It presents new challenges and new hopes to people with disabilities.

HTML4, developed in the late ’90s and released in 1998, emphasized separating document structure and meaning from presentational or stylistic concerns. This was based on semantic web principles, and partly motivated by improving support for accessibility. The HTML5 that we currently use builds on these ideas, and so supporting assistive technology is central to its design.

So, how exactly do browsers and HTML support screen readers today?

Many front-end developers are unaware that the browser parses the DOM to create a data structure, especially for assistive technologies. This is a tree structure known as the accessibility tree that forms the API for screen readers, meaning that we no longer rely on intercepting the rendering process as the offscreen model approach did. HTML yields one representation that the browser can use both to render on a screen, and also give to audio or braille devices.

HTML yields a DOM tree, which can be used to render a view, and to build up an accessibility tree that assistive tech like screen readers use.
Browsers use the DOM to render a view, and to create an accessibility tree for screen readers. (Large preview)

Let’s look at the accessibility API in a little more detail to see how it handles the challenges we considered above. Nodes of the accessibility tree, called “accessible objects,” correspond to a subset of DOM nodes and have attributes including role (such as button), name (such as the text on the button), and state (such as focused) inferred from the HTML markup. Screen readers then use this representation of the page.

This is how a screen reader user can know an element is a button without making use of the visual style cues that a sighted user depends on. How could a screen reader user find relevant information on a page without having to read through all of it? In a recent survey, screen reader users reported that the most common way they locate the information they are looking for on a page is via the page’s headings. If an element is marked up with an h1h6 tag, a node in the accessibility tree is created with the role heading. Screen readers have a “skip to next heading” functionality, thereby allowing a page to be skimmed.

Some HTML attributes are specifically for the accessibility tree. ARIA (Accessible Rich Internet Applications) attributes can be added to HTML tags to specify the corresponding node’s name or role. For instance, imagine our button above had an icon rather than text. Adding aria-label="sign up" to the button element would ensure that the button had a label for screen readers to represent to their users. Similarly, we can add alt attributes to image tags, thereby supplying a name to the corresponding accessible node and providing alternative text that lets screen reader users know what’s on the page.

The downside of the semantic approach is that it requires developers to use HTML tags and aria attributes in a way that matches their code’s intent. This, in turn, requires awareness among developers, and prioritization of accessibility by their teams. Lack of awareness and prioritization, rather than any technical limitation, is currently the main barrier to an accessible web.

So the current approach to assistive tech for the web is based on semantic web principles and baked into the design of browsers and HTML. Developers and their teams have to be aware of the accessibility features built into HTML to be able to take advantage of them.

Recommended reading: Accessibility APIs: A Key To Web Accessibility by Léonie Watson

AI Connections

Machine Learning (ML) and Artificial Intelligence (AI) come to mind when we read Berners-Lee’s remarks about the dream of the semantic web today. When we think of computers being intelligent agents analyzing data, we might think of this as being done via machine learning approaches. The early offscreen model approach we looked at used heuristics to classify visual information. This also feels reminiscent of machine learning approaches, except that in machine learning, heuristics to classify inputs are based on an automated analysis of previously seen inputs rather than hand-coded.

What if in the early days of figuring out how to make the web accessible we had been thinking of using machine learning? Could such technologies be useful now?

Machine learning has been used in some recent assistive technologies. Microsoft’s SeeingAI and Google’s Lookout use machine learning to classify and narrate objects seen through a smartphone camera. CTRL Labs is working on a technology that detects micro-muscle movements interpreted with machine learning techniques. In this way, it seemingly reads your mind about movement intentions and could have applications for helping with some motor impairments. AI can also be used for character recognition to read out text, and even translate sign language to text. Recent Android advances using machine learning let users augment and amplify sounds around them, and to automatically live transcribe speech.

AI can also be used to help improve the data that makes its way to the accessibility tree. Facebook introduced automatically generated alternative text to provide user images with screen reader descriptions. The results are imperfect, but point in an interesting direction. Taking this one step further, Google recently announced that Chrome will soon be able to supply automatically generated alternative text for images that the browser serves up.

What’s Next

Until (or unless) machine learning approaches become more mature, an accessible web depends on the API based on the accessibility tree. This is a robust solution, but taking advantage of the assistive tech built into browsers requires people building sites to be aware of them. Lack of awareness, rather than any technical difficulty, is currently the main challenge for web accessibility.

Key Takeaways

  • Designing for different sets of abilities can give us new insights and lead to innovations that are broadly useful.
  • The web was intended to be accessible from the start, and the history of the web is intertwined with the history of assistive tech for the web.
  • Assistive tech for the web is baked into the current design of browsers and HTML.
  • Designing assistive tech, particularly involving AI, is continuing to provide new insights and lead to innovations.
  • The main current challenge for an accessible web is awareness among developers, designers, and product managers.

Resources

Smashing Editorial (dm, yk, il)

Create a program to read marks of 10 students for 2 different marks

I am trying to create a program can read marks of 10 student for different marks using C program but when I debug the output that shown was not the value that I input before, it keeps showing 7 digit value. Need someone advise, what is the misstake of my code. Below is my code.

#include <stdio.h> 
int main() 
{ 
int i, j;  
int marks[2][10];
printf("Enter the marks of the ten students :\n");

for(i=0;i<10;i++)
{
  printf("\nEnter the marks of student :%d",i);

  printf("\nAssignment Mark :");
  scanf("%d",marks[0]);  

  printf("Exam Mark :");
  scanf("%d",marks[1]);
}
printf("****************************************************************\n");
for(j=0;j<10;j++)
{
 printf("Student No :%d\n",j);
 printf("Assignment Marks :%d\n",&marks[0]);
 printf("Exam Marks :%d\n",&marks[1]);            
}                 
getch();
return 0;
}