Home page

Showing posts with label Error. Show all posts
Showing posts with label Error. Show all posts

Thursday, September 12, 2019

Not getting missing package specific import suggestions in feature file for @Given / @When / @Then annotations ?

Reason: Dependency (cucumber-java & cucumber-jvm-deps) are missing in pom.xml file.

Solution:
1. Go to https://mvnrepository.com/
2. Search with cucumber-java
3. Select info.cukes » cucumber-java
4. Click latest version (1.2.5)
5. Copy 

    <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>1.2.5</version>
    </dependency>
6. Paste in pom.xml
7. Search with cucumber-jvm-deps
8. Select info.cukes » cucumber-jvm-deps
9. Click latest version (1.0.5)
10. Copy  

     <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-jvm-deps</artifactId>
            <version>1.0.5</version>
            <scope>provided</scope>
    </dependency>
11. Paste in pom.xml

Tuesday, September 10, 2019

Types of exceptions in Selenium WebDriver

Types of exceptions in Selenium
  1. NoSuchElementException ---> When driver failed to locate element from DOM.
  2. NoSuchWindowException/NoSuchFrameException ---> While Switching between windows/frames failed to find mentioned window/frame
  3. NoAlertFoundException ---> Written alert Accept/Dismiss code at the wrong place
  4. TimeOutException ---> When given command failed to complete task in alloted time
  5. ElementNotVisibleException ---> Element is present in the DOM but not visible.
  6. InvalidSessionIDException ---> When session id gets expired
  7. JavaScriptException ---> When javascript executor contains incorrect JavaScript code
  8. StaleElementException ---> Once element stopped appearing in the DOM then StaleElementException.
  9. UnsupportedOperationException---> By mistake used method(deselectAll()) of Select class for single select dropdown. deselectAll() can only be used for multi-select dropdown
  10. SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 75 ---> It is due to browser version and chrome driver version compatibility mismatch. If your browser is updated with latest version than check compatible chrome driver version. Replace old chrome driver with compatible one.

org.openqa.selenium.nosuchelementexception



org.openqa.selenium.NoSuchWindowException

org.openqa.selenium.NoSuchFrameException

org.openqa.selenium.noalertpresentexception

org.openqa.selenium.TimeoutException

org.openqa.selenium.elementnotvisibleexception

selenium.common.exceptions.invalidsessionidexception

org.openqa.selenium.javascriptexception

org.openqa.selenium.staleelementreferenceexception

java.lang.UnsupportedOperationException

org.openqa.selenium.SessionNotCreatedException

If you are aware of any other types of exception in Selenium then write in the comment. 

Thursday, July 18, 2019

maven error: Could not calculate build plan

maven error:

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6


Solution:

Right click project > Maven > Update Project: Check “Force Update of Snapshots/Release” checkbox and click OK button.
 

Friday, November 30, 2018

How to solve StaleElementException

Reason behind StaleElementException: Element gets destroy and gets recreated.

  1. Refresh page
  2. Use ‘try-catch block’ within ‘for loop’
  3. Wait for the element till it gets available
  4. Using POM

Tuesday, November 27, 2018

How to solve java.lang.NoSuchMethodError:

How to solve
java.lang.NoSuchMethodError:
com.google.common.util.concurrent.SimpleTimeLimiter.create(Ljava/util/concurrent/ExecutorService;)Lcom/google/common/util/concurrent/SimpleTimeLimiter;

Steps to resolve:
1. Open POM.xml
2. Find <groupId>com.google.guava</groupId>
3. Change version of guava from 21.0 to 23.0
4. Save the file and wait for project to update the jar

Tuesday, August 21, 2018

How to solve Jmeter 4.0: java.io.FileNotFoundException: rmi_keystore.jks (The system cannot find the file specified)

How to solve jmeter 4.0:  java.io.FileNotFoundException: rmi_keystore.jks (The system cannot find the file specified)

Steps to resolve:
1. Open jmeter.PROPERTIES file from bin folder
2. Uncomment this line: server.rmi.ssl.truststore.password=changeit
3. Uncomment this line: server.rmi.ssl.disable=false and make it true. [e.g server.rmi.ssl.disable=true]

4. Restart Jmeter server

Monday, August 6, 2018

Showing error mark on pom.xml

Showing error mark on pom.xml

Steps to resolve:
1. Right click on Project
2. Go to Maven > Update Project
3. Check "Force Update of Snapshots/Releases" checkbox
4. Click OK button and wait for update to complete.

Thursday, November 16, 2017

java.lang.NoSuchMethodError, method got strikeout and no Javadoc found

Problem observed:
Got exception: java.lang.NoSuchMethodError
Also method got strikeout: On hovering the method it shows "This element neither has attached source nor attached Javadoc and hence no Javadoc could be found."


Solution:

1. Eclipse > Right click Project > Maven > Download Javadoc
2. Check POM.xml and validate JAR files version in the application.

Tuesday, September 29, 2015

Java exception occurred

Error: Java exception occurred
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.NullPointerException

Solution: Declare "WebDriverWait wait" at method/function level instead of at class level.

The method addArguments(String[]) in the type ChromeOptions is not applicable for the arguments (String)

Error: The method addArguments(String[]) in the type ChromeOptions is not applicable for the arguments (String)

Solution: 
1. Go to project > Properties > Java Compiler
2. Uncheck "Use compliance from execution environment ...." checkbox
3. Select 1.7 from dropdown "Compiler compliance level"
4. Click Apply button
5. Click Yes from "Compiler Settings Changed" popup
6. Click OK button