Giter VIP home page Giter VIP logo

selenium-cucumber-java's People

Contributors

dependabot[bot] avatar frozenbe avatar geekdenz avatar olufunbi avatar sameer49 avatar vaishnavigunwante avatar vertisinfotechsameer avatar vertisinfotechvaishnavi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

selenium-cucumber-java's Issues

login with multiple users in feature file

How to login with multiple users in feature file ? Can you please explain me through example ?

When I execute with this Feature file. I am getting this error..

Feature: Gmail Login
As a user I should able to login into Gmail.

Scenario: I login with valid credential
Given I navigate to "http://the-internet.herokuapp.com/login"
And I enter "tomsmith" into input field having id "username"
And I enter "SuperSecretPassword!" into input field having id "password"
When I click on element having class "radius"
Then I should get logged-in
Then I close browser

Scenario: I login with valid credential
Given I navigate to "http://the-internet.herokuapp.com/login"
And I enter "tomsmith" into input field having id "username"
And I enter "SuperSecretPassword!" into input field having id "password"
When I click on element having class "radius"
Then I should get logged-in
Then I close browser

Starting ChromeDriver 2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f) on port 25096
Only local connections are allowed.
Nov 13, 2017 8:53:54 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
Starting ChromeDriver 2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f) on port 23910
Only local connections are allowed.
Nov 13, 2017 8:54:00 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS

org.openqa.selenium.NoSuchSessionException: Session ID is null. Using WebDriver after calling quit()?
Build info: version: '3.5.2', revision: '10229a9', time: '2017-08-21T17:29:55.15Z'
System info: host: 'VCESB03', ip: '192.168.0.154', os.name: 'Windows Server 2012 R2', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_121'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:131)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:641)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:368)
at info.seleniumcucumber.methods.NavigateMethods.navigateTo(NavigateMethods.java:23)
at info.seleniumcucumber.stepdefinitions.PredefinedStepDefinitions.navigate_to(PredefinedStepDefinitions.java:27)
at ✽.Given I navigate to "http://the-internet.herokuapp.com/login"(E:/Bibhu/devPortal/src/test/resources/features/my_first.feature:13)

Skipped step

Skipped step

Skipped step

Skipped step

Skipped step
URL: data:,
src:

Failed scenarios:
E:/Bibhu/devPortal/src/test/resources/features/my_first.feature:12 # Scenario: I login with valid credential
2 Scenarios (1 failed, 1 passed)
11 Steps (1 failed, 5 skipped, 5 passed)
0m10.486s

org.openqa.selenium.NoSuchSessionException: Session ID is null. Using WebDriver after calling quit()?
Build info: version: '3.5.2', revision: '10229a9', time: '2017-08-21T17:29:55.15Z'
System info: host: 'VCESB03', ip: '192.168.0.154', os.name: 'Windows Server 2012 R2', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_121'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:131)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:641)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:368)
at info.seleniumcucumber.methods.NavigateMethods.navigateTo(NavigateMethods.java:23)
at info.seleniumcucumber.stepdefinitions.PredefinedStepDefinitions.navigate_to(PredefinedStepDefinitions.java:27)
at ✽.Given I navigate to "http://the-internet.herokuapp.com/login"(E:/Bibhu/devPortal/src/test/resources/features/my_first.feature:13)

Issue with timeout for step "I wait <duration> seconds for element having xpath ..."

Hi,
We observed issue with "I wait 20 seconds for element having xpath "XPATH" to display" and
same step for element to get enable.
Let's say if we define time for wait as 20 seconds , then it is actually waiting for 20 * 1000 i.e 20000 seconds.
This is because of following code.

  public void waitForElementToDisplay(String accessType, String accessName,  String duration) {
	By byEle = getelementbytype(accessType, accessName);
	WebDriverWait wait = (new WebDriverWait(driver, Integer.parseInt(duration) * 1000));
  	wait.until(ExpectedConditions.visibilityOfElementLocated(byEle));
}

           public void waitForElementToClick(String accessType, String accessName, String duration) {
	By byEle = getelementbytype(accessType, accessName);
	WebDriverWait wait = (new WebDriverWait(driver, Integer.parseInt(duration) * 1000));
	wait.until(ExpectedConditions.elementToBeClickable(byEle));
}

We should not multiply duration with 1000. Please remove it.

Make usable as a library

Soon after I published this to a Maven repository, I noticed, that one cannot use this as a library. I've changed my own fork a lot and after a lot of googling and browsing through the Cucumber Java source code found that it is indeed possible to use the step definitions from this library:

https://github.com/geekdenz/selenium-cucumber-java/blob/fb23d90fee928718458370d4f9922bf46c937b20/src/test/java/stepDefintions/RunCukeTest.java#L13

Also see the README:
https://github.com/geekdenz/selenium-cucumber-java/blob/master/README.md#using-canned-tests-in-your-project

You are more than welcome to merge these changes in. I also made it so that if a test fails, it makes a screenshot and puts it into the directory with the scenario ID.

Also, I made the headless Firefox the default driver, so this can be used on a build server. For this some libraries may need to be installed:

sudo apt install libgtk-3-0 libdbus-glib-1-2 xvfb

Publish to Maven Repository

I had to build this and then install it. It would be best if this would be published to a central Maven Repository for easier use. I am happy to do it, but think I should give the maintainers a chance to do it since this repository is dedicated to this project.

Build Fails on basic test

Need an upgraded driver for this to work again. If I get a chance I wouldn't mind contributing more to this project as it looks like we can really use it.

How to execute each scenario for each @test

Hi,

Lets say, within my .feature file, i do have 3 Scenarios (A, B & C), I have all define into definition file.
Now i have a requirement to execute each scenario from each @test of TestNG. How to execute per scenario 1 @test?

So that whenever i have executed, every scenario should consider as a separate test case.

Thanks for the help in advance

Thanks,
Mahesh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.