What is considered to be the bug with switched javascript
- 21.07.2017
- Posted by: Admin
What is Javascript
JavaScript was originally created to make web pages «alive». It was planned that Javascript would be a kind of «little brother» of Java. However, it soon grew strongly and is now a completely independent language with its own specification that has nothing to do with Java. Programs in this language are called scripts. In the browser, they connect directly to HTML and, as soon as the page loads, are executed immediately. JavaScript programs are plain text. They do not require special training. Javascript can run not only in the browser, but anywhere. This requires only a special program – an interpreter. If you consider Javascript as one of the languages for creating sites, then it does not require a program. All major browsers have a built-in interpreter by default. That's why they can run scripts on a page.What can Javascript do
Modern JavaScript is a «secure» general-purpose programming language. It does not provide low-level means of working with memory, a processor, as it was originally focused on browsers that do not require it. As for other features – they depend on the environment in which JavaScript is running. In the browser JavaScript is able to do everything related to the manipulation of the page, interaction with the visitor and, to some extent, with the server:- create new HTML tags, delete existing ones, change element styles, hide, show elements, etc.;
- respond to user actions, process mouse clicks, move the cursor, press the keyboard, etc.;
- send requests to the server and download data without reloading the page (this technology is called «AJAX»);
- receive and set cookies, make data requests, display messages…
What can’t Javascript do
JavaScript – is a fast and powerful language but the browser imposes some restrictions on execution. This is done for the safety of users so that an attacker could not use JavaScript to obtain personal data or harm the user's computer. These restrictions do not exist where JavaScript is used outside the browser, such as on a server. In addition, modern browsers provide their own mechanisms for installing plug-ins and extensions, which have advanced features but require special installation actions from the user.Javascript cannot:
- read/write random files to your hard drive, copy them or call programs. It does not have direct access to the operating system; Device access capabilities are also addressed in modern standards and are partially available in some browsers;
- interact with other tabs and windows, unless it opened this window or several tabs from one source (same domain, port, protocol) by itself. There are ways to work around this, but they require special code for both documents, which are in different tabs or windows. Without it, for security reasons, you can't get from one tab to another using JavaScript;
- with JavaScript, you can easily send requests to the server from which the page came. A request for another domain is also possible, but less convenient, as there are security restrictions.
Advantages of Javascript
Javascript provides several activities:
- full integration with HTML/CSS;
- no deep knowledge of the language is required to create simple things;
- support of all common browsers and is enabled by default.
What can be considered as a bug with inactive Javascript?
It really depends on the circumstances. For most browsers, JavaScript is enabled by default, because for most sites it is required for it to work. For example, Google Sheets tables without JavaScript can only be viewed, but editing functionality will not be available. But is it really a bug? The answer is no. When you open the spreadsheet, you are presented with a friendly message about the need for JavaScript for the tool to work correctly, which lets the user know exactly what is wrong and what they need to do to access the edit. JavaScript is often used to «decorate» a site. Smooth image enlargement, pop-up menus, field animations, and more are all often implemented via JavaScript. But what to do if it is disabled? A lot of developers provide the ability to run the site without JavaScript, implementing the functionality in a simplified form in HTML or CSS or transferring some of the functionality to the server. Maybe everything does not look so beautiful, but the main thing is that all the functionality is available to the user and works properly. Sometimes developers use the method of progressive improvement. The site is first written in HTML and its functionality is implemented, and then this functionality is improved, supplemented, and expanded by JavaScript libraries.So, what’s the feature, and what’s the bug then?
In most cases, this depends entirely on how the system is described in the documentation. If the functionality in the absence of JavaScript is ignored in the documentation, then you need to rely on common sense, as sometimes even developers and customers can not say for sure whether a bug is a particular script.Some examples of bugs with disabled JavaScript:
- incorrect operation of the system as a whole with frequent errors;
- lack of important functionality that was present when JavaScript was enabled;
- defects blocking the system without explaining the need for JavaScript to work;
- lack of field validation that was carried out by JavaScript;
- sending incorrect data to the server (checked on the server-side or through a proxy server);
- incorrect display of layout (graphic artifacts, offset of fields and buttons, etc.);
- broken page navigation buttons.
Some examples of not-a-bug:
- the functionality is changed, but still present in one form or another;
- changed design;
- when you go to another page, the whole page reloads instead of refreshing only the content you want to change;
- the page does not automatically load new content, but a list of pages appears.
Examples of the correct display of the page with disabled JavaScript
Correct behavior when JavaScript is disabled Google search is a good and simple example. First of all – design. Because much of the site relies on JavaScript to play animations, navigate, and open menus, the design has been changed to make it easier to use without JavaScript. The Google Partition menu items are placed in the title of the page, as they are displayed inside the container, which was opened by JavaScript. Search filters that have been implemented as drop-down menus are displayed as items next to search results. The second is functional. When you switch between tabs or search results pages, the entire page reloads to display new content that was previously updated JavaScript dynamically, without the need to reload.Examples of the incorrect display of the page with disabled JavaScript
No hint of JavaScript required (Webmaker.org)The site simply does not display any content. Moreover, no errors are displayed to tell the user what needs to be done to fix the problem.
Lack of necessary functionality In this example, when you click on the «Login» or «Register» when JavaScript is enabled, a pop-up window appears with fields for authorization or registration in the system. However, if JavaScript is disabled, the script that opens these windows will not run, so users who have JavaScript disabled will not be able to log in to their accounts.Conclusions
JavaScript has long been one of the main ways to run scripts on web pages, so many people take it for granted without even thinking about how everything will work without it. When testing a site with JavaScript disabled, you need to understand that without it, the site will most likely not work as intended, but it must perform basic functions. Users without JavaScript will be too upset if they open, for example, their favorite online store to choose gifts for the holiday and at the last moment will realize that they can not add the product to the cart. But you don't need to be too demanding either, because if instead of the drop-down menu the users see that all the items are available, but in a slightly different form – they can forgive it.Tags
bug
bug-report
game testing
glossary
homework assessment
Lecture #1 of software testing courses
Lecture #2 of software testing courses
Lecture #3 of software testing courses
Lecture #4 of software testing courses
Lecture #5 of software testing courses
Lecture #6. Software Testing: Basics and Practice
Lecture #7. Software Testing: Basics and Practice
lecture materials
mobile testing
QA terms
qa tips for beginner
self-training
test case
test design
training organizational questions