*<dependency>*
* <groupId>junit</groupId>*
* <artifactId>junit</artifactId>*
* <version>4.11</version>*
*</dependency>*
<dependency>
<groupId>net.sourceforge.jwebunit</groupId>
<artifactId>jwebunit-htmlunit-plugin</artifactId>
<version>3.1</version>
</dependency>
should i delete the top portion of the includes?
On Tue, Jul 8, 2014 at 6:58 PM, Dhruv Shah <dhruvshah...@gmail.com> wrote:
> I am not using junit assert anywhere.
> I just wrote the second piece of code because the jwebunit asserts were
> failing.
>
>
> On Tue, Jul 8, 2014 at 6:57 PM, Julien HENRY <henr...@yahoo.fr> wrote:
>
>> Right. But JUnit is not a web testing framework.
>>
>> ------------------------------
>> *De :* Dhruv Shah <dhruvshah...@gmail.com>
>> *À :* Julien HENRY <henr...@yahoo.fr>; Usage problems for JWebUnit <
>> jwebunit-users@lists.sourceforge.net>
>> *Envoyé le :* Mardi 8 juillet 2014 15h23
>> *Objet :* Re: [JWebUnit-users] Fwd: Regarding
>> "assertWindowPresentWithTitle()"
>>
>> But the jwebunit requires the junit maven dependencies to be present
>> right?
>>
>>
>> On Tue, Jul 8, 2014 at 6:17 PM, Julien HENRY <henr...@yahoo.fr> wrote:
>>
>>
>>
>> Hi,
>>
>> It seems your are mixing some Selenium (WebDriver) code and some
>> JWebUnit code. Please stick to a single web testing framework.
>>
>> ++
>>
>> Julien
>>
>> ------------------------------
>> *De :* Dhruv Shah <dhruvshah...@gmail.com>
>> *À :* jwebunit-users@lists.sourceforge.net
>> *Envoyé le :* Mardi 8 juillet 2014 14h37
>> *Objet :* [JWebUnit-users] Fwd: Regarding
>> "assertWindowPresentWithTitle()"
>>
>>
>>
>> Hello All,
>>
>> *When i use the following code(not using JWebUnit)* :
>>
>> String originalWindow = driver.getWindowHandle();
>> for(String str:driver.getWindowHandles()){
>> if(str!=originalWindow)
>> driver.switchTo().window(str);
>> }
>> assertEquals("New Pharmacy: Add For EMedPass",driver.getTitle());
>> }
>>
>> *my code works perfectly. The test results returns a true*.
>>
>> *When i use the following code (using JWebUnit) :*
>>
>> for(String str:driver.getWindowHandles()){
>> System.out.println(driver.switchTo().window(str).getTitle());
>> }
>> assertWindowPresentWithTitle("New Pharmacy: Add For EMedPass");
>>
>> *the assert fails. It gives the following output :*
>>
>> testCase1(JunitTest1): null
>> testCase1(JunitTest1)
>> null
>> java.lang.NullPointerException
>> at
>> net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.getWindowByTitle(HtmlUnitTestingEngineImpl.java:1027)
>> at
>> net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.hasWindowByTitle(HtmlUnitTestingEngineImpl.java:317)
>> at
>> net.sourceforge.jwebunit.junit.WebTester.assertWindowPresentWithTitle(WebTester.java:2234)
>> at
>> net.sourceforge.jwebunit.junit.JWebUnit.assertWindowPresentWithTitle(JWebUnit.java:1735)
>> at JunitTest1.testCase1(JunitTest1.java:70)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> at java.lang.reflect.Method.invoke(Method.java:606)
>> at
>> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
>> at
>> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>> at
>> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
>> at
>> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>> at
>> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
>> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
>> at
>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
>> at
>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
>> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
>> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
>> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
>> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
>> at
>> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
>> at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
>> at org.junit.runners.Suite.runChild(Suite.java:127)
>> at org.junit.runners.Suite.runChild(Suite.java:26)
>> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
>> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
>> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
>> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
>> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
>> at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
>> at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
>> at org.junit.runner.JUnitCore.run(JUnitCore.java:138)
>> at org.junit.runner.JUnitCore.run(JUnitCore.java:128)
>> at org.junit.runner.JUnitCore.runClasses(JUnitCore.java:73)
>> at TestRunner1.main(TestRunner1.java:12)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> at java.lang.reflect.Method.invoke(Method.java:606)
>> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
>>
>> *Here is the TestRunner class for reference:*
>>
>> Result result = JUnitCore.runClasses(JunitTest1.class);
>> System.out.println("\n\n\n"+result.getFailureCount());
>> for(Failure failure : result.getFailures()){
>> System.out.println(failure.toString());
>> System.out.println(failure.getDescription());
>> System.out.println(failure.getMessage());
>> System.out.println(failure.getTrace());
>> }
>> System.out.println(result.wasSuccessful());
>>
>> }
>>
>> *I'm new to the mailing list. If there is some protocol I'm ignoring,
>> please let me know and I will make an endeavor to follow it next time. *
>>
>> *Thanking you*
>> *Dhruv Shah*
>>
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Open source business process management suite built on Java and Eclipse
>> Turn processes into business applications with Bonita BPM Community
>> Edition
>> Quickly connect people, data, and systems into organized workflows
>> Winner of BOSSIE, CODIE, OW2 and Gartner awards
>> http://p.sf.net/sfu/Bonitasoft
>>
>> _______________________________________________
>> JWebUnit-users mailing list
>> JWebUnit-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Open source business process management suite built on Java and Eclipse
>> Turn processes into business applications with Bonita BPM Community
>> Edition
>> Quickly connect people, data, and systems into organized workflows
>> Winner of BOSSIE, CODIE, OW2 and Gartner awards
>> http://p.sf.net/sfu/Bonitasoft
>> _______________________________________________
>> JWebUnit-users mailing list
>> JWebUnit-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users
>>
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Open source business process management suite built on Java and Eclipse
>> Turn processes into business applications with Bonita BPM Community
>> Edition
>> Quickly connect people, data, and systems into organized workflows
>> Winner of BOSSIE, CODIE, OW2 and Gartner awards
>> http://p.sf.net/sfu/Bonitasoft
>> _______________________________________________
>> JWebUnit-users mailing list
>> JWebUnit-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users
>>
>>
>
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
JWebUnit-users mailing list
JWebUnit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jwebunit-users