Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
zlos7ar
Amateur
Amateur
Posts : 41
Join date : 2012-01-13
Age : 36
Location : Germany

Internet Explorer driver Empty Internet Explorer driver

Wed Feb 08, 2012 6:24 pm
Hey guys its me again. I have a problem with IE driver....
When i run my test in firefox it works perfectly. In IE it opens the webpage but It does not want to input anything after that. Here is my code:


Code:
package com.example.tests;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverBackedSelenium;
import org.openqa.selenium.ie.InternetExplorerDriver;

import com.thoughtworks.selenium.SeleneseTestBase;

public class MoreAndSubmitIdea extends SeleneseTestBase {
   @Before
   public void setUp() throws Exception {
      WebDriver driver = new InternetExplorerDriver();
      String baseUrl = "https://englisch.my-ideanet-test.de/login.php";
      selenium = new WebDriverBackedSelenium(driver, baseUrl);
   }

   @Test
   public void testMoreAndSubmitIdea() throws Exception {
      selenium.open("/login.php");
      selenium.type("name=login_user", "admin");
      selenium.type("//*[@id='content-container']/div[1]/form/div[2]/div[2]/input", "password");
      selenium.click("css=div.center > input[name=\"submit\"]");
      selenium.waitForPageToLoad("30000");
      Thread.sleep(2000);
      selenium.click("//div[text()='more']");
      selenium.fireEvent("//div[text()='more']", "click");
      Thread.sleep(1000);
      assertTrue(selenium.isTextPresent("Ideenaufruf"));
      selenium.click("//button[3]");
      Thread.sleep(2000);
      selenium.click("//div[text()='more']");
      selenium.fireEvent("//div[text()='more']", "click");
      assertTrue(selenium.isTextPresent("Ideenaufruf"));
      selenium.click("//span[text()='Show submitted ideas']");
      selenium.waitForPageToLoad("30000");
      assertTrue(selenium.isTextPresent("All ideas are listed here - maybe you find something new!"));
      selenium.click("link=Home");
      selenium.waitForPageToLoad("30000");
      Thread.sleep(2000);
      selenium.click("//div[text()='more']");
      selenium.fireEvent("//div[text()='more']", "click");
      Thread.sleep(1000);
      selenium.click("//button[2]");
      selenium.waitForPageToLoad("30000");
      Thread.sleep(3000);
      assertTrue(selenium.isTextPresent("Your Draft ideas"));
      assertTrue(selenium.isElementPresent("//*[@id='popup']/div/table/tbody/tr[1]/td[1]/a"));
      String firstidea = selenium.getText("//*[@id='popup']/div/table/tbody/tr[1]/td[1]/a");
      System.out.println(firstidea);
      selenium.click("link=" + firstidea);
      selenium.waitForPageToLoad("30000");
      verifyEquals(firstidea, selenium.getValue("name=title"));
      selenium.click("link=Home");
      selenium.waitForPageToLoad("30000");
      selenium.click("//div[text()='more']");
      selenium.fireEvent("//div[text()='more']", "click");
      assertTrue(selenium.isTextPresent("Ideenaufruf"));
      selenium.click("css=span.ui-icon.ui-icon-closethick");
      selenium.click("//div[text()='submit idea']");
      Thread.sleep(4000);
      assertTrue(selenium.isTextPresent("Your Draft ideas"));
      selenium.click("css=span.ui-icon.ui-icon-closethick");
      assertTrue(selenium.isTextPresent("Title*"));
      selenium.click("link=Home");
      selenium.waitForPageToLoad("30000");
   }

   @After
   public void tearDown() throws Exception {
      selenium.stop();
   }
}


Failure Trace:


com.thoughtworks.selenium.SeleniumException: JavaScript error (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 230 milliseconds
Build info: version: '2.18.0', revision: '15704', time: '2012-01-27 15:48:16'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_02'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.internal.seleniumemulation.SeleneseCommand.apply(SeleneseCommand.java:42)
at org.openqa.selenium.internal.seleniumemulation.Timer.run(Timer.java:39)
at org.openqa.selenium.WebDriverCommandProcessor.execute(WebDriverCommandProcessor.java:145)
at org.openqa.selenium.WebDriverCommandProcessor.doCommand(WebDriverCommandProcessor.java:75)
at com.thoughtworks.selenium.DefaultSelenium.type(DefaultSelenium.java:310)
at com.example.tests.MoreAndSubmitIdea.testMoreAndSubmitIdea(MoreAndSubmitIdea.java:23)
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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.openqa.selenium.WebDriverException: JavaScript error (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 230 milliseconds
Build info: version: '2.18.0', revision: '15704', time: '2012-01-27 15:48:16'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_02'
Driver info: driver.version: RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:147)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:113)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:439)
at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:353)
at org.openqa.selenium.internal.seleniumemulation.AlertOverride.replaceAlertMethod(AlertOverride.java:27)
at org.openqa.selenium.internal.seleniumemulation.Type.handleSeleneseCommand(Type.java:48)
at org.openqa.selenium.internal.seleniumemulation.Type.handleSeleneseCommand(Type.java:1)
at org.openqa.selenium.internal.seleniumemulation.SeleneseCommand.apply(SeleneseCommand.java:36)
... 30 more



Console:


Feb 08, 2012 12:18:01 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
Information: I/O exception (java.net.SocketException) caught when processing request: Software caused connection abort: recv failed
Feb 08, 2012 12:18:01 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
Information: Retrying request

===================================================
I have no clue what the problem might be...
I am with Windows 7, Internet Explorer 9, Eclipse and Selenium 2.18.0

avatar
qappbc
Amateur
Amateur
Posts : 38
Join date : 2011-10-13

Internet Explorer driver Empty Re: Internet Explorer driver

Fri Feb 10, 2012 2:19 am
When I went to site using IE8 manually I saw a security warning from IE.

Normally you can accept the warning and proceed if it is a 'known' test site by using: selenium.chooseOkOnNextConfirmation()

or, you can omit going to the secured form of the site by deleting the 's' char in the url - http(s): This will bypass the security certificate warning.
avatar
zlos7ar
Amateur
Amateur
Posts : 41
Join date : 2012-01-13
Age : 36
Location : Germany

Internet Explorer driver Empty Re: Internet Explorer driver

Fri Feb 10, 2012 6:13 pm
The thing is that even if i remove the http(s): I am automatically redirected to it. Can you give me a bit more details on how to use "selenium.chooseOkOnNextConfirmation()" and are you sure thats what I need ? "in IDE when I select the command I get this reference: Undo the effect of calling chooseCancelOnNextConfirmation. Note that Selenium's overridden window.confirm() function will normally automatically return true, as if the user had manually clicked OK, so you shouldn't need to use this command unless for some reason you need to change your mind prior to the next confirmation.After any confirmation, Selenium will resume using the default behavior for future confirmations, automatically returning true (OK) unless/until you explicitly call chooseCancelOnNextConfirmation for each confirmation.

Take note - every time a confirmation comes up, you must consume it with a corresponding getConfirmation, or else the next selenium operation will fail. "

Lets say I confirm it at the start , but in the middle of the test I want to go to my email account to check if I have received notification email. Then I get the same confirmation and if I click cancel the test fails and it continues with the next test if I click ok all test after that fail. The error massage looks like this : Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window. The error message is: No default value
Sponsored content

Internet Explorer driver Empty Re: Internet Explorer driver

Back to top
Permissions in this forum:
You cannot reply to topics in this forum