Cross Browser testing via Eclipse

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Cross Browser testing via Eclipse

Adrien007
-how to invoke iexplore ?
-In 'IMDB' example it also invokes RC server but we dont, so whats teh significance of invoking RC server, are we lacking if we don't do that?

For beginners, In last thread we have learned that there are some mandatory jar files one need to run test via eclipse using testng.
1)Selenium Rc server.jar
2)Install Testng plugin - using Install software in eclipse

Please add more if I am missing...
Reply | Threaded
Open this post in threaded view
|

Re: Cross Browser testing via Eclipse

softwaretestingforum
Administrator
I suppose you are using webdriver, in that case just use -

driver = new InternetExplorerDriver();

and it should execute your tests in IE browser.
When using WebDriver you don't need RC server.
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: Cross Browser testing via Eclipse

Adrien007
Its not working that way,
and encounter another error :
[TestNG] Running:
  C:\Users\pushpraj.singh\AppData\Local\Temp\testng-eclipse-1764969122\testng-customsuite.xml

FAILED: testBing
org.junit.ComparisonFailure: expected:<[bing wiki - ]Bing> but was:<[]Bing>
        at org.junit.Assert.assertEquals(Assert.java:125)
        at org.junit.Assert.assertEquals(Assert.java:147)
        at com.example.tests.Bing.testBing(Bing.java:37)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
        at org.testng.internal.Invoker.invokeMethod(Invoker.java:699)
        at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:891)
        at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1215)
        at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
        at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
        at org.testng.TestRunner.privateRun(TestRunner.java:758)
        at org.testng.TestRunner.run(TestRunner.java:613)
        at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
        at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
        at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
        at org.testng.SuiteRunner.run(SuiteRunner.java:240)
        at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
        at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:87)
        at org.testng.TestNG.runSuitesSequentially(TestNG.java:1170)
        at org.testng.TestNG.runSuitesLocally(TestNG.java:1095)
        at org.testng.TestNG.run(TestNG.java:1007)
        at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:109)
        at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:202)
        at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:173)


===============================================
    Default test
    Tests run: 1, Failures: 1, Skips: 0
===============================================


===============================================
Default suite
Total tests run: 1, Failures: 1, Skips: 0
===============================================

[TestNG] Time taken by org.testng.reporters.XMLReporter@133796: 14 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@1e4cbc4: 10 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter@4741d6: 7 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@b166b5: 33 ms
[TestNG] Time taken by [TestListenerAdapter] Passed:0 Failed:0 Skipped:0]: 14 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@c2a132: 68 ms


How to fix :
"org.junit.ComparisonFailure"??
Reply | Threaded
Open this post in threaded view
|

Re: Cross Browser testing via Eclipse

softwaretestingforum
Administrator
That looks like a genuine test failure -

org.junit.ComparisonFailure: expected:<[bing wiki - ]Bing> but was:<[]Bing>
        at org.junit.Assert.assertEquals(Assert.java:125)

You must see IE being launched. Don't you?
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: Cross Browser testing via Eclipse

Pushpraj Singh
No It just don't accept it that way:
"I suppose you are using webdriver, in that case just use -

driver = new InternetExplorerDriver();
"



 though same code launched firefox and run the test case successfully but not entire test case, it gets halt in between and gave that comparison failure error.
Reply | Threaded
Open this post in threaded view
|

Re: Cross Browser testing via Eclipse

Adrien007
Error in eclipse console this time:
[TestNG] Running:
  C:\Users\pushpraj.singh\AppData\Local\Temp\testng-eclipse-1927627385\testng-customsuite.xml

FAILED: testBing
org.junit.ComparisonFailure: expected:<[bing wiki - ]Bing> but was:<[]Bing>
        at org.junit.Assert.assertEquals(Assert.java:125)
        at org.junit.Assert.assertEquals(Assert.java:147)
        at com.example.tests.Bing.testBing(Bing.java:37)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
        at org.testng.internal.Invoker.invokeMethod(Invoker.java:699)
        at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:891)
        at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1215)
        at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
        at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
        at org.testng.TestRunner.privateRun(TestRunner.java:758)
        at org.testng.TestRunner.run(TestRunner.java:613)
        at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
        at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
        at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
        at org.testng.SuiteRunner.run(SuiteRunner.java:240)
        at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
        at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:87)
        at org.testng.TestNG.runSuitesSequentially(TestNG.java:1170)
        at org.testng.TestNG.runSuitesLocally(TestNG.java:1095)
        at org.testng.TestNG.run(TestNG.java:1007)
        at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:109)
        at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:202)
        at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:173)


===============================================
    Default test
    Tests run: 1, Failures: 1, Skips: 0
===============================================


===============================================
Default suite
Total tests run: 1, Failures: 1, Skips: 0
===============================================

[TestNG] Time taken by org.testng.reporters.XMLReporter@82c01f: 17 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter@80f4cb: 10 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@19616c7: 33 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@578ceb: 8 ms
[TestNG] Time taken by [TestListenerAdapter] Passed:0 Failed:0 Skipped:0]: 15 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@9ed927: 101 ms


Video:http://screencast.com/t/wkQfDgC0dRaG
Reply | Threaded
Open this post in threaded view
|

Re: Cross Browser testing via Eclipse

Illusion0Reality
In reply to this post by Adrien007
Are you under any sort of Microsoft Firewall Client - or something similar?
Or running at home.
Sometimes, these firewalls prevent browsers from being opened.
Reply | Threaded
Open this post in threaded view
|

Re: Cross Browser testing via Eclipse

Adrien007
No Dear, Browser opened and test case ran seccessfully but halts in between.
Please see video , there I showed entire test case first via selenium ID and second via Eclipse ID when it halts.
I think if there was a firewall problem same system wouldn't have run the tests yesterday.
Reply | Threaded
Open this post in threaded view
|

Re: Cross Browser testing via Eclipse

Illusion0Reality
Oops, I had it wrongly !
Reply | Threaded
Open this post in threaded view
|

Re: Cross Browser testing via Eclipse

Adrien007
So have you figured out whats wrong?
Reply | Threaded
Open this post in threaded view
|

Re: Cross Browser testing via Eclipse

softwaretestingforum
Administrator
Did you keep a debug point at line which throws error -

org.junit.ComparisonFailure: expected:<[bing wiki - ]Bing> but was:<[]Bing>

tried to debug it?
~ seleniumtests.com