Posts

Testng - java.lang.NoClassDefFoundError: com/google/inject/Stage -- during configuration

Image
Why I am getting Below error: Exception in thread "main" java.lang.NoClassDefFoundError: com/google/inject/Stage at org.testng.internal.Configuration.<init>(Configuration.java:33) at org.testng.TestNG.init(TestNG.java:216) at org.testng.TestNG.<init>(TestNG.java:200) at org.testng.remote.AbstractRemoteTestNG.<init>(AbstractRemoteTestNG.java:17) at org.testng.remote.support.RemoteTestNG6_12.<init>(RemoteTestNG6_12.java:18) at org.testng.remote.support.RemoteTestNGFactory6_12.createRemoteTestNG(RemoteTestNGFactory6_12.java:16) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:67) Caused by: java.lang.ClassNotFoundException: com.google.inject.Stage at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 7 more Answer: This error u...

RUN Selenium Test Cases in Docker – Advantages and challenges

Image
What is Docker?   Docker is a container platform that provides virtualization from the operating system level. In Docker, all software parts can be organized in containers. This includes the operating system, software, dependencies, environment variables, etc. Containers can be shared among different users, enabling quick installation and running of software and services. This makes Docker handy for automation testing, as the relevant container can just be downloaded and run as part of the automated test. However, Docker is also secure because it runs as an isolated process on the host machine. Docker can be run on any computer on any infrastructure as well as in the cloud, including Linux, Windows, Mac, Amazon, Azure and etc.  Pro's of using Docker Docker is open source. This means that you can find many images (used to generate containers) on the web and use them.   Docker can be an integral part of Continuous Deployment and Continuous Testing, by ensuring y...

Stale element reference error in Selenium Scripting and how to solve it?

 Stale element reference error and solution What is Stale element reference error❓❓ The  stale element reference error occurs when the referred element not attached to the DOM. Every DOM element is represented in WebDriver by a unique identifying reference, known as a web element. The web element reference is a UUID used to execute commands targeting specific elements, such as getting an element’s tag name and retrieving a property off an element. When an element is no longer attached to the DOM, i.e. it has been removed from the document or the document has changed, it is said to be stale. Staleness occurs for example when you have a web element reference and the document it was retrieved from navigates. The Error Trace is: org.openqa.selenium.StaleElementReferenceException: stale element  reference: element is not attached to the page document Solution - 1: Wait till the element is properly rendered and clickable, use below code: WebDriverWait wait =...

Implicit vs Explicit vs Fluent And Sleep in Selenium

  Why Do We Need Selenium Waits when there is Sleep in java ? Most of the time a common problem faced by almost all automation tester is " ElementNotVisibleException ".   I saw the people scratching their head because of this!. Visually, when seeing the UI execution of script, we face a common question that, "we can see the element but why our script cant find this!!"❓ here is the catch! Usually, when navigation happens from one page to other/ on dynamically loading or hiding elements, there will be a delay of fractions. Hence, some time our eye won't catch that, though script may encounter of fail to find element. Hence, to resolve this we should apply wait! Types of Selenium Waits For Page Load Thread.Sleep() method Implicit Wait Explicit Wait Fluent Wait https://play.google.com/store/apps/details?id=com.shikshan.app Thread.Sleep()  For Automation Testing with Selenium Sleep is a static method that belongs to the thread class in java. This method can...

Selenium Page Object Generator Chrome Extension

Image
Selenium Page Object Generator Chrome Extension This chrome extension helps in creating the page object class for Selenium WebDriver with locators for all available elements and methods to access them. It uses a template to generate the class which can be customized from the settings page of the extension. Selenium Page Object Generator is a good tool to improve the workflow. It will generate Page Object Model on active Chrome tab with a single click, provided that all the options and template are configured. The generated Page Object Model can be saved to pre-configured Chrome download folder. It currently supports 3 different targets: Java, C#, and Robot Framework. You can search for this extension in Chrome Browser. PageObjectGenerator Extension Once we add this extension to Chrome, we can easily generate Page Objects for the applications which we need to automate. Usage: Launch Chrome browser and the extension can be found at the top rig...

Software Engineering Ethics and Professional Practices Principle 2

Image

Software Engineering Ethics and Professional Practices Principle 1

Image

Run Selenium Tests In Headless Google Chrome

Run Selenium Tests In Headless Google Chrome Selenium is one of the most popular, open source and efficient browser automation tools available today. With Selenium Web Driver, it automates several (browser) actions, such as opening a webpage, clicking a link, checking the URL, and so on. But there are cases when you may need to run automation tests in ‘headless’ mode, i.e., when no browser is being displayed. In these cases, you can execute Selenium tests in headless browsers. This is useful when testing in cloud Dockers/linux What Is A Headless Browser? A headless browser is a simulation module/browser which do not have user interface. These programs operate like any other browser, but do not display any UI. When Selenium tests are run, it executes in the background Benefits Of Headless Browser Testing: 1. Improves speed and performance Since this type of testing does not actually open a browser, the system saves the processing power that would otherwise be used...

How to inspect disappearing element in a browser:

Image
How to inspect disappearing element in a browser: In selenium scripting we should  use right techniques for identifying the web elements. In few cases when there is disappearing items like KendoUI, we should use smart ways/techniques for identifying the elements rather than spending lot of time behind analyzing the javascript/reactjs codes. Technique/Tools  1.  For finding the elements and xpaths, we can use the tools like  ChroPath, CSS Selector or any other Chrome plugins 2. Once we identified the proper xpath or elements with id/css, we can confirm its presence with similar tools like Xpath Helper Wizard Then, we can use it in our page factory logic So, challenge here is, few elements like KendoUI date pickers closes soon after changing the focus,  To find elements of these kind we can use 2 techniques: 1. In Chrome,  Open devTools (F12) Select the "Sources" tab While the element you want is displayed, press F8...

Evolution of Selenium

Image
Evolution of Selenium - Part 1 Selenium Webdriver Selenium Record and playback IDE Selenium GRID Why Selenium: 1. Its open-source and highly matured tool for web testing 2. Open source tool 3. Selenium have huge user base with wider support 4. User can choose different binding languages depends on need 5. As it is language independent, it robust and easy to access Database or APIs for deep verification Different Types of Selenium : S elenium Webdriver  If you are beginning with desktop website or mobile website test automation, then you sghould use WebDriver APIs. WebDriver uses browser automation APIs provided by browser vendors to control browser and run tests. This is as if a real user is operating the browser. Since WebDriver does not require its API to be compiled with application code, it is not intrusive. Hence, you are testing the same application which you push live. Selenium IDE IDE (Integrated Development Environment)...

Bandwidth Throttle : a new way to simulate various network speed for Client-Server apps

Image
Bandwidth throttling  is the intentional slowing of Internet service by an Internet service provider. It is a reactive measure employed in communication networks in an apparent attempt to regulate network traffic and minimize  bandwidth  congestion. Now a days releasing the client-server application to the market without testing it in all  possible network speeds such as Edge/2G/3G/4G/LTE various Wi-fi speeds, tethering etc is very dangerous. This is highly risk prone areas for the client-server apps. Normally the companies would be having high speed internet/4G  connections and the QA Team forgets about the normal end user cases such as  network  disturbances, low bandwidth, repeated disconnection etc... Then what would be the solution for this? How the QA should identify this in early stage? The solution found by moderntester is Bandwidth  throttling  using proxy tools! Charles can be used to adjust the bandwidth...

NETWORK CONDITIONS AN IMPORTANT AREA TO TEST : MOBILE APPs

Imagine if your bank’s website were to display the following disclaimer on its homepage: “We do not guarantee the security of your personal data or your account information while transacting on our net-banking portal”. Will you still use it? Almost certainly not! There are four things to consider in this area: Support for different network channels:  Mobile devices can communicate with the network on one or more channels such as SMS, USSD, WiFi, GPRS (2G/3G/4G), WAP, etc. Certain functions in your application may not perform well (or at all) on certain channels and protocols. If you wish to support only the high capacity channels such as WiFi, or 3G/4G/LTE, you will risk shutting out the vast majority of low-end devices which may not support these radios. On the other hand if you do not specify which are the required (or recommended) channels for your application, it may result in the users inadvertently trying your application’s high-bandwidth features on a low-bandwid...

Testing CPU and Memory usage of Mobile Apps

  When an application is developed to run on a particular software platform such as J2ME, Android etc. it can in theory be installed and run on any device that supports that platform. However for any given platform, the supported devices could have a very wide range of capabilities in terms of CPU speed and available memory. For example a J2ME application can be theoretically run on a low end feature phone such as the Nokia 112 with a sub 250 MHz CPU and 16 MB of internal RAM as well as a higher end Nokia ASHA 300 series phone with 1 GHZ+ CPU and 128 MB internal RAM. However if the app has been designed to require a certain minimum CPU power and memory, it will in practice, fail on the Nokia 112 phone. If your application makes extensive use of arithmetic and logic operations such as those involved in streaming and decompression of audio and video and in rich animations, or it lets the user view and manipulate large sets of information or images, you should specify minimum CPU an...

Software Product

Image
Normally, we are getting an answer saying that the Software Product is nothing but a computer program that runs in a platform and executes the intended function. But as per moderntesters, software product is not only an app/software program but it is a set of Software Program, data associated with it, documentation and procedures. These altogether forms a Software Product. What is Software Program? It is nothing but the actual code with which the functionality is implemented and compiled for the specific platforms. E.g, Apps for iOS, Android, windows etc… The Data in the software product is nothing but the piece of data provided with software in-order to operate it. E.g, the licence keys provided with software. Now, documentation is the help/guide that demonstrates about the usage of the software/licence stuffs etc. Procedure clearly explains the set of actions/steps that should be followed to work properly with the targeted software.