[Cucumber-JVM] Test class not found in specific project

1,667 views
Skip to first unread message

Manasi86

unread,
Jan 4, 2016, 11:20:28 AM1/4/16
to Cukes
Hello, 


This is my very first project using Cucumber+Selenium+Java(Not used Maven at all). I have created a java project in which I have add all cucumber jars and selenium jars. I have attached the code snippets in the attached file. 

Now when I run  testrunner, I am getting this error for the Login functionality.

Also, when I run same test in selenium its working fine. 

It would be a great help if you can tell me where I am making mistake. 

Thanks, 
Manasi




TestSteps.txt
Testrunner.txt
feature.txt
error.png
Projectlayout.png

Thomas Sundberg

unread,
Jan 4, 2016, 2:34:27 PM1/4/16
to cu...@googlegroups.com
It is very hard to say whats wrong. But, you show us an exception from
Selenium, NoSuchElementFound, that states that an element can't be
found. I see that as an indication that it can be a problem related to
Selenium and your web application and not Cucumber.

The way I would approach a problem like this is to remove piece by
piece until I got something that worked and then work my way back to
where I wanted to be.

I would start with validating that the steps I expected would be
called actually where called. This can be done with
System.out.println(); in those methods.

I would ignore Selenium before I knew if Cucumber where working as
expected or not. This would give me a smaller problem to work with and
with some luck a problem I can solve.

HTH
Thomas


>
>
>
> --
> Posting rules: http://cukes.info/posting-rules.html
> ---
> You received this message because you are subscribed to the Google Groups
> "Cukes" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cukes+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Thomas Sundberg
M. Sc. in Computer Science

Mobile: +46 70 767 33 15
Blog: http://thomassundberg.wordpress.com/
Twitter: @thomassundberg

Better software through faster feedback

Manasi86

unread,
Jan 5, 2016, 11:08:15 AM1/5/16
to Cukes, t...@kth.se
Thank Thomas for your reply, 

The reason this error coming is : there is no login page.

According to the code , first my account button should be clicked, the login credentials should be entered and then after successful login you should logout.

Now If I run selenium test this functionality is working. But with test runner class……. it is just opening the demo website in browser, not clicking on it.

And it is directly going to the logout scenario. That y the error is there, as there is no logout button on the browser.

So, my problem is why it is not entering into Given scenario.


Thanks, 

Manasi



Thomas Sundberg

unread,
Jan 5, 2016, 6:53:05 PM1/5/16
to cu...@googlegroups.com
If you are entering the steps as expected, then is your problem not a
Cucumber problem. All I can suggest then is that you troubleshoot and
ask yourself why the expected web application isn't seen as you
expect. That will probably give you more clues on how to proceed.

Good luck!
Thomas


>
> Thanks,
>
> Manasi
Reply all
Reply to author
Forward
0 new messages