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