JavascriptException with IE 11 browser, iedriver 3.6.

55 views
Skip to first unread message

alok arya

unread,
Nov 2, 2017, 1:05:05 AM11/2/17
to Selenium Users
Hi,
  I tried running the below javascript code with iedriver 3.6 on windows 8.1 64 bit, JDK 8u151 64 bit:

((JavascriptExecutor)driver).executeScript("var tab = document.getElementsByTagName(\"table\")[0];var ele = tab.getElementsByTagName(\"div\");for(var i = 0; i < ele.length; i++){if(\"File\" == ele[i].textContent.trim()){ele[i].click();break;}}");

It throws the following error:

2017-11-02 04:39:04 ERROR [main] (WebUtils.java:1122) - Exception occured while Navigation to Menu: File ==> New ==> Cabinet !!
2017-11-02 04:39:04 ERROR [main] (WebUtils.java:1122) - Exception occured while Navigation to Menu: File ==> New ==> Cabinet !!
org.openqa.selenium.JavascriptException: JavaScript error
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T16:15:40.131Z'
System info: host: 'VM-001', ip: '10.194.38.187', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_151'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{acceptInsecureCerts=false, browserVersion=11, se:ieOptions={nativeEvents=true, browserAttachTimeout=0, ie.ensureCleanSession=false, elementScrollBehavior=0, enablePersistentHover=true, ie.browserCommandLineSwitches=, ie.forceCreateProcessApi=false, requireWindowFocus=false, initialBrowserUrl=http://localhost:28093/, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, ignoreProtectedModeSettings=true}, browserName=internet explorer, pageLoadStrategy=normal, javascriptEnabled=true, platformName=WINDOWS, setWindowRect=true, platform=WINDOWS}]
Session ID: 5c4f054c-ae24-4363-b179-04ee62df848b
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:185)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:120)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:586)
at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:522)
at com.opentext.webtop.utils.WebUtils.navigateToMenu(WebUtils.java:1043)
at com.opentext.webtop.pageobjects.CabinetsPage.navigateToNewCabinetMenu(CabinetsPage.java:57)
at com.opentext.webtop.steps.webtop_acceptance_testsuite.acc_create_cabinet.the_user_navigates_to_the_new_cabinet_menu(acc_create_cabinet.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at cucumber.runtime.Utils$1.call(Utils.java:37)
at cucumber.runtime.Timeout.timeout(Timeout.java:13)
at cucumber.runtime.Utils.invoke(Utils.java:31)
at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:38)
at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
at cucumber.runtime.Runtime.runStep(Runtime.java:299)
at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:91)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.ExamplesRunner.run(ExamplesRunner.java:59)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.ScenarioOutlineRunner.run(ScenarioOutlineRunner.java:53)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:93)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:37)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.api.junit.Cucumber.run(Cucumber.java:98)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
2017-11-02 04:39:04  INFO [main] (acc_create_cabinet.java:124) - Scenario Status: failed
2017-11-02 04:39:04  INFO [main] (acc_create_cabinet.java:125) - Scenario isFailed: true
2017-11-02 04:39:04  INFO [main] (WebUtils.java:2401) - 2017_11_02 04_39_04_AM

  @createCabinet @AcceptanceTestSuite
  Scenario Outline: Create Cabinet                                                       # webtop_acceptance_testsuite/acc_create_cabinet.feature:17
    Given the user login to the application with 'Administrator' 'Password@123'          # acc_create_cabinet.the_user_login_to_the_application_with(String,String)
    And the user navigates to the tree node cabinets in browser tree 'Cabinets'          # acc_create_cabinet.the_user_navigates_to_the_tree_node_cabinets_in_browser_tree(String)
    And the user navigates to the new cabinet menu                                       # acc_create_cabinet.the_user_navigates_to_the_new_cabinet_menu()
      java.lang.AssertionError
      at org.junit.Assert.fail(Assert.java:86)
      at org.junit.Assert.fail(Assert.java:95)
      at com.opentext.webtop.utils.WebUtils.navigateToMenu(WebUtils.java:1124)
      at com.opentext.webtop.pageobjects.CabinetsPage.navigateToNewCabinetMenu(CabinetsPage.java:57)
      at com.opentext.webtop.steps.webtop_acceptance_testsuite.acc_create_cabinet.the_user_navigates_to_the_new_cabinet_menu(acc_create_cabinet.java:75)
      at ?.And the user navigates to the new cabinet menu(webtop_acceptance_testsuite/acc_create_cabinet.feature:8)

    When the user creates a new cabinet 'acc_create_cabinet' 'Cabinet (dm_cabinet)'      # acc_create_cabinet.the_user_creates_a_new_cabinet(String,String)
    Then verify a new cabinet is created 'acc_create_cabinet'                            # acc_create_cabinet.verify_a_new_cabinet_is_created(String)
    Then the user clicks the cabinet name link to check its content 'acc_create_cabinet' # acc_create_cabinet.the_user_clicks_the_cabinet_name_link_to_check_its_content(String)
    Then verify the message no items found                                               # acc_create_cabinet.verify_the_message_no_items_found()
    And the user logout from the application                                             # acc_create_cabinet.the_user_logout_from_the_application()
2017-11-02 04:39:04  INFO [main] (RunCucumberTest.java:45) - Ran the after
2017-11-02 04:39:09  INFO [main] (CommonLib.java:353) - Task List: iexplore.exe                  1760 RDP-Tcp#6                  2     30,604 K
2017-11-02 04:39:09  INFO [main] (RunCucumberTest.java:69) - The Process 'iexplore.exe' is Running!!
2017-11-02 04:39:12  INFO [main] (RunCucumberTest.java:75) - The Process 'iexplore.exe' is Killed Successfully!!

Failed scenarios:
webtop_acceptance_testsuite/acc_create_cabinet.feature:17 # Scenario Outline: Create Cabinet

1 Scenarios (1 failed)
8 Steps (1 failed, 5 skipped, 2 passed)
1m19.990s

java.lang.AssertionError
at org.junit.Assert.fail(Assert.java:86)
at org.junit.Assert.fail(Assert.java:95)
at com.opentext.webtop.utils.WebUtils.navigateToMenu(WebUtils.java:1124)
at com.opentext.webtop.pageobjects.CabinetsPage.navigateToNewCabinetMenu(CabinetsPage.java:57)
at com.opentext.webtop.steps.webtop_acceptance_testsuite.acc_create_cabinet.the_user_navigates_to_the_new_cabinet_menu(acc_create_cabinet.java:75)
at ?.And the user navigates to the new cabinet menu(webtop_acceptance_testsuite/acc_create_cabinet.feature:8)


Could you please help in resolving this issue.

Thanks,
Alok

Krishnan Mahadevan

unread,
Nov 2, 2017, 11:04:26 AM11/2/17
to seleniu...@googlegroups.com

Do you know if the Javascript that you have created is valid and works fine ? The error says :

 

org.openqa.selenium.JavascriptException: JavaScript error

Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T16:15:40.131Z'

 

 

                                              

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/dbd10f47-82c9-4b3c-9024-2ed40990583f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

alok arya

unread,
Nov 2, 2017, 12:46:55 PM11/2/17
to Selenium Users
Yes Krishnan. Javascript works fine. I have verified the output using alert display. Same javascript works fine with firefox and chrome and also along with 3.3.0 iedriver alongwith other drivers.

Best Regards,
Alok
Reply all
Reply to author
Forward
0 new messages