navinmtp / selenium

selenium
0 stars 0 forks source link

Selenium IE Webdriver fails with Jenkins #1

Open navinmtp opened 9 years ago

navinmtp commented 9 years ago

The IE Webdriver works fine separately, but when integrated with Jenkins, it shows the below error message..The error message is followed by the code.

Started InternetExplorerDriver server (32-bit) 2.45.0.0 Listening on port 2712 Able to Access GCM Login Page! username entered Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to find element with name == Title (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 335 milliseconds For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html Build info: version: '2.45.0', revision: '32a636c', time: '2015-03-05 22:01:35' System info: host: 'ITKTT2WND001', ip: '10.77.120.1', os.name: 'Windows Server 2008 R2', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_45' Driver info: org.openqa.selenium.ie.InternetExplorerDriver Capabilities [{browserAttachTimeout=0, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.usePerProcessProxy=false, ignoreZoomSetting=false, handlesAlerts=true, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:2712/, takesScreenshot=true, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=dismiss}]


The actual code is :

DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer(); capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true); capabilities.setCapability("ignoreZoomSetting", true); File file = new File("C:/tools/IEDriverServer_Win32_2.45.0/IEDriverServer.exe"); System.setProperty("webdriver.ie.driver", file.getAbsolutePath());

InternetExplorerDriver driver = new InternetExplorerDriver(capabilities); System.out.println("open the browser with the system independent configurations set");

driver.manage().window().maximize(); String baseUrl = "URL-1"; String expectedTitle = "GCM NonSSO Login"; String actualTitle = ""; driver.get(baseUrl); actualTitle = driver.getTitle(); if (actualTitle.contentEquals(expectedTitle)){ System.out.println("Able to Access GCM Login Page!"); } else { System.out.println("Not able to Access GCM Login Page!"); } driver.findElement(By.id("UserName")).sendKeys("8656000613"); System.out.println("username entered"); driver.findElement(By.id("Password")).sendKeys("123456");
driver.findElement(By.xpath("html/body/div[1]/form/table/tbody/tr[3]/td/input")).click(); driver.get("URL-2"); System.out.println("before wait command"); WebDriverWait wait = new WebDriverWait(driver, 15);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("Description")));

navinmtp commented 9 years ago

Hi, any updates on this please