Subsequent calls to Geb Spock Test from GroovyConsole fail with UnreachableBrowserException - groovy

I'm running the below script (a GebReportingSpec test case) from within GroovyConsole.exe. It runs properly the first time, when GroovyConsole is launched. It opens up FF, runs the scenario, and then closes FF on quitting the browser.
However, when I run the same script again from the same GroovyConsole, I get an UnreachableBrowserException. It first calls setupSpec() method, and then on calling the go method inside the test case, it calls cleanupSpec()...
GEB:
0.9.0
Selenium:
2.26.0
Groovy:
2.0.5
FF:
14.0.1
JDK:
1.6.0_37 64-Bit
Script:
#Grapes([
#Grab("org.gebish:geb-core:0.9.0"),
#Grab("org.gebish:geb-spock:0.9.0"),
#Grab("org.seleniumhq.selenium:selenium-firefox-driver:2.26.0"),
//#Grab("org.seleniumhq.selenium:selenium-chrome-driver:2.26.0"),
#Grab("org.seleniumhq.selenium:selenium-support:2.26.0")
])
import geb.Browser
import geb.spock.GebReportingSpec
import org.openqa.selenium.firefox.*
class Google_Search_Test extends GebReportingSpec {
def setupSpec() {
println "Inside setupSpec()..."
browser.config.autoClearCookies = true
}
def cleanupSpec() {
println "Inside cleanupSpec()..."
println "Quitting browser..."
browser.quit()
}
def "google_search_wikipedia"() {
println "Inside google_search_wikipedia..."
when:
println "Going to google.com..."
go "http://google.com/ncr"
// make sure we actually got to the page
assert title == "Google"
// enter wikipedia into the search field
$("input", name: "q").value("wikipedia")
// wait for the change to results page to happen
// (google updates the page dynamically without a new request)
waitFor { title.endsWith("Google Search") }
// is the first link to wikipedia?
def firstLink = $("li.g", 0).find("a.l")
then:
firstLink.text() == "Wikipedia"
println "Finished test execution..."
}
}
GebConfig.groovy:
import org.openqa.selenium.firefox.*
import java.util.concurrent.*
driver = {
FirefoxProfile firefoxProfile = new FirefoxProfile()
firefoxProfile.setPreference("capability.policy.default.Window.frameElement", "allAccess")
def driver = new FirefoxDriver(firefoxProfile)
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS)
driver.manage().timeouts().pageLoadTimeout(60, TimeUnit.SECONDS)
driver
}
waiting {
// all values are in seconds
timeout = 60
retryInterval = 0.5
}
reportsDir = "SeleniumReports"
Successful run:
Inside setupSpec()...
Inside google_search_wikipedia...
Going to google.com...
Finished test execution...
Inside cleanupSpec()...
Quitting browser...
JUnit 4 Runner, Tests: 1, Failures: 0, Time: 15739
Subsequent runs (Exception):
Inside setupSpec()...
Inside google_search_wikipedia...
Going to google.com...
Inside cleanupSpec()...
Quitting browser...
JUnit 4 Runner, Tests: 1, Failures: 2, Time: 687
Test Failure: google_search_wikipedia(Google_Search_Test)
org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '2.26.0', revision: '18040', time: '2012-11-02 09:44:45'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_37'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:526)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:275)
at geb.Browser.go(Browser.groovy:371)
at geb.Browser.go(Browser.groovy:363)
at geb.spock.GebSpec.methodMissing(GebSpec.groovy:51)
at Google_Search_Test.google_search_wikipedia(Google_Search.groovy:27)
Caused by: org.openqa.selenium.WebDriverException: The FirefoxDriver cannot be used after quit() was called.
Build info: version: '2.26.0', revision: '18040', time: '2012-11-02 09:44:45'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_37'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.execute(FirefoxDriver.java:351)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:505)
... 5 more
Test Failure: google_search_wikipedia(Google_Search_Test)
org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '2.26.0', revision: '18040', time: '2012-11-02 09:44:45'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_37'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:526)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:535)
at org.openqa.selenium.remote.RemoteWebDriver.getPageSource(RemoteWebDriver.java:396)
at geb.report.PageSourceReporter.getPageSource(PageSourceReporter.groovy:42)
at geb.report.PageSourceReporter.writePageSource(PageSourceReporter.groovy:38)
at geb.report.PageSourceReporter.writeReport(PageSourceReporter.groovy:29)
at geb.report.CompositeReporter.writeReport(CompositeReporter.groovy:31)
at geb.Browser.report(Browser.groovy:698)
at geb.spock.GebReportingSpec.report(GebReportingSpec.groovy:43)
at geb.spock.GebReportingSpec.cleanup(GebReportingSpec.groovy:39)
Caused by: org.openqa.selenium.WebDriverException: The FirefoxDriver cannot be used after quit() was called.
Build info: version: '2.26.0', revision: '18040', time: '2012-11-02 09:44:45'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_37'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.execute(FirefoxDriver.java:351)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:505)
... 9 more

Geb has a concept of driver caching so that only one browser window is opened and reused and you're hitting a problem with using it from groovy console. Geb manages driver/browser instances for you and the cache is active throughout the life of the VM. You are getting the error because you are manually quitting the driver (which shouldn't be done if driver cache is enabled) and the VM has not been shut down (groovy console is still running between the two executions) which means that the browser managed by the driver retrieved from cache has been shut down.
You have two options here, the second better in my opinion:
do not quit the driver - one browser window will be opened and reused across the subsequent executions of your tests
use a build system, for example Gradle (an example Geb project built using Gradle is avaialable here) - this will shut down the VM after execution of your test(s) and it will also automatically shut down the browser

Related

Is it possible to use selenium on an arm64 device which has a linux server?

I'm trying to run selenium on an arm64 device with linux server, since I cannot install chrome on this device, I want to use chromium or firefox browser in headless mode. But I'm getting different errors every time I run my selenium program. here is the error log while using chromium:
/root/.cache/selenium/chromedriver/linux-arm64/101.0.4951.41/chromedriver: 1: Syntax error: "(" unexpected
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:585)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:248)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:164)
at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:108)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:106)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:93)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:82)
at dev.emad.selenium.book.Main$Companion.main(Main.kt:43)
at dev.emad.selenium.book.Main.main(Main.kt)
Caused by: org.openqa.selenium.WebDriverException: Driver server process died prematurely.
Build info: version: '4.1.3', revision: '7b1ebf28ef'
System info: host: 'FriendlyELEC', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'aarch64', os.version: '5.10.60', java.version: '11.0.14.1'
Driver info: driver.version: ChromeDriver
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:226)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:98)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:567)
... 8 more
I have tried xvfb but it didn't help, And here is he code that I'm using:
WebDriverManager.chromedriver().setup()
val chromeOptions = ChromeOptions().apply {
setHeadless(true)
addArguments(
"--disable-infobars",
"--disable-extensions",
"--disable-application-cache",
"--disable-gpu",
"--disable-dev-shm-usage",
"--dns-prefetch-disable",
"--ignore-ssl-errors",
"--ignore-certificate-errors",
"--no-sandbox",
"--window-size=1920,1080",
"--remote-debugging-port=9222"
)
}
chromeOptions.setBinary("/usr/bin/chromium-browser")
driver = ChromeDriver(chromeOptions)
driver.get("https://bing.com")

Cannot find Microsoft Edge binary

Try to start a selenium test with the edge driver and get an exception
Everything is working fine with firefox and chrome, but I couldn't manage it to start edge (Version 77.0.223.0 (Official build) dev (64-bit)).
This is my test class
class EdgeTest {
private static String binaryPath;
private WebDriver driver;
#BeforeEach
public void setupTest() {
WebDriverManager.edgedriver().setup();
binaryPath = WebDriverManager.edgedriver().getBinaryPath();
WebDriverManager.edgedriver().browserPath("C:\\Program Files (x86)\\Microsoft\\Edge Dev\\Application\\msedge.exe\")");
System.setProperty("webdriver.edge.driver", binaryPath);
driver = new EdgeDriver();
}
#After
public void teardown() {
if (driver != null) {
driver.quit();
}
}
#Test
public void test() {
// Your test code here. For example:
WebDriverWait wait = new WebDriverWait(driver, 30);
driver.get("https://en.wikipedia.org/wiki/Main_Page");
}
This is the exception I get:
org.openqa.selenium.WebDriverException: unknown error: cannot find Microsoft Edge binary
Build info: version: '3.141.0', revision: '2ecb7d9a', time: '2018-10-31T20:09:30'
System info: host: 'IRVING', ip: '192.168.56.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_212'
Driver info: driver.version: EdgeDriver
remote stacktrace: Backtrace:
Ordinal0 [0x00007FF7845DD422+1823778]
Ordinal0 [0x00007FF7845457B2+1202098]
And logs
14:46:46.411 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager - Edge Dev (based on Chromium) version 77 found
14:46:46.415 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager - Driver for edge77 not found in local properties
14:46:46.668 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager - The driver version for Microsoft Edge 77 is unknown ... trying with latest
14:46:46.669 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager - Reading https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ to find out the latest version of Edge driver
14:46:47.050 [main] INFO i.g.bonigarcia.wdm.WebDriverManager - Latest version of Edge driver is 77.0.229.0
14:46:47.060 [main] INFO io.github.bonigarcia.wdm.Downloader - Using binary driver previously downloaded
14:46:47.060 [main] INFO i.g.bonigarcia.wdm.WebDriverManager - Exporting webdriver.edge.driver as C:\Users\cseegraef\.m2\repository\webdriver\edgedriver\win64\x64\77.0.229.0\msedgedriver.exe
Previous : 1.8.0_212-b03
Starting MSEdgeDriver 77.0.229.0 (219d9c8b098bc5511828863cd68c4e880c69814b) on port 46356
Only local connections are allowed.
Please protect ports used by the WebDriver and related test frameworks to prevent access by malicious code.
Thanks for any help or information.

Chromedriver couldn't open chrome browser on AWS EC2

I'm trying to run simple Java code to setup EC2 machine on AWS and its pure purpose is to run selenium.
The same code on my local (MAC) works fine, just by changing the chrome path
I could start chromedriver and google-chrome independently with out issues.
chromedriver version - 71.0.3578.80
Google Chrome 71.0.3578.98
Here it is the Java Code
import java.io.IOException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;
public class TecAdminSeleniumTest {
public static void main(String[] args) throws IOException, InterruptedException {
System.setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver");
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--headless");
chromeOptions.addArguments("--no-sandbox");
WebDriver driver = new ChromeDriver(chromeOptions);
driver.get("https://google.com");
Thread.sleep(1000);
if (driver.getPageSource().contains("I'm Feeling Lucky")) {
System.out.println("Pass");
} else {
System.out.println("Fail");
}
driver.quit();
}
}
Error observed:
Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:11:15'
System info: host: 'XXXXXXX', ip: 'XXXXXX', os.name: 'Linux', os.arch: 'amd64', os.version: '4.14.77-70.59.amzn1.x86_64', java.version: '1.8.0_25'
I keep getting the following exception :
Driver info: org.openqa.selenium.chrome.ChromeDriver
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:408)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:216)
at org.openqa.selenium.chrome.ChromeDriver.startSession(ChromeDriver.java:182)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:111)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:115)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:161)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:150)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:139)
This error message...
Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:11:15' System info: host: 'XXXXXXX', ip: 'XXXXXX', os.name: 'Linux', os.arch: 'amd64', os.version: '4.14.77-70.59.amzn1.x86_64', java.version: '1.8.0_25'
...implies that there are some incompatibility between the version of the binaries you are using as follows:
Your Selenium Client version is 2.39.0 of 2013-12-16 16:11:15 which is more than 5 years older.
Your JDK version is 1.8.0_25 which is pretty ancient.
So there is a clear mismatch between the JDK v8u25 and Selenium Client v2.39
Solution
Upgrade JDK to recent levels JDK 8u191.
Upgrade Selenium to current levels Version 3.141.59.
Upgrade ChromeDriver to current ChromeDriver v2.45 level.
Keep Chrome version between Chrome v70-72 levels. (as per ChromeDriver v2.45 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
Free Up and Release the Unused/Cached Memory in Ubuntu/Linux Mint before and after the execution of your Test Suite.
If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
Take a System Reboot.
Execute your #Test.

How to set Firefox Binary path of firefox in selenium in Linux?

Exception in thread "main" org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: LINUX Build info: version: 'unknown', revision: '1969d75', time: '2016-10-18 09:43:45 -0700'
System info: host: 'skalia', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.19.0-25-generic', java.version: '1.8.0_111'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.firefox.internal.Executable.<init>(Executable.java:75)
at org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:60)
at org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:56)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:127)
at pack.SeleTest.main(SeleTest.java:10)
This is the error i get during running selenium script which is working Fine on Window PC. I set all the Build path. Add all selenium jars.
Help me to solve it.
Either add your Firefox binary to the PATH variable or set it programmatically using a constructor of FirefoxDriver taking a FirefoxBinary, like this one:
FirefoxDriver(FirefoxBinary binary, FirefoxProfile profile);
To find out the path to your firefox binary on Linux, run this command in a shell:
which firefox
If this does not show a path or shows an error nessage, then Firefox is not installed on your Linux system (if it is installed on your Windows PC, then this is the reason why it works there).
IN JAVA Language:
If you install firefox in default location you just write:
WebDriver driver = new FirefoxDriver();
For other location you can coding like below:
File browserAppPath = null;
if (Platform.getCurrent().is(Platform.WINDOWS)) {
browserAppPath = new File("C:\\Program Files\\Mozilla Firefox\\firefox.exe");
if (!browserAppPath.exists()) {
browserAppPath = new File("C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe");
}
} else {
// Ubuntu
browserAppPath = new File("/usr/bin/firefox/firefox-bin");
}
WebDriver driver = new FirefoxDriver( new FirefoxBinary(browserAppPath), new FirefoxProfile());

Jasmine is timing out in protractor, Selenium Server crashes afterwards (issue is present in Chrome, Firefox - OK)

Really need some help on this one, I have been struggling for a really long time and cant figure it out on my own!
I am running tests in chrome and when protractor logs in to the system, it suddenly stops and , basically, crashes -
at first Jasmine is timing out (explicitly extended the timeout),enter code here
and then protractor cant quit the browser for long time (Log from
Selenium Server -Timed out receiving message from renderer: 295.458,
Timed out receiving message from renderer: 10.000)
So here is the code:
describe('Login with username and password', function () {
it('Logging in with VALID credentials', function () {
browser.get('');
expect(browser.getCurrentUrl()).toContain('login');
element(by.id('username')).sendKeys("username");
element(by.id('password')).sendKeys("password");
element(by.css('input[type="submit"]')).click();//here I am login into the system. On successful login, system loads lots of resources into the browser for subsequent bus logic
// browser.waitForAngular();
expect(browser.getCurrentUrl()).toContain('main');
var greeting = element(by.css("div.greeting"));
expect(greeting.getText()).toEqual('Hei, admin');
element(by.css('.logout')).click();
});
});
Log from protractor when it fails to quit browser and/or Selenium Server.
C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:109
var template = new Error(this.message);
^
ScriptTimeoutError: timeout: Timed out receiving message from renderer: 10.000
(Session info: chrome=37.0.2062.103)
(Driver info: chromedriver=2.10.267521,platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 310.28 seconds
Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:03'
System info: host: 'LVALTP1065', ip: '192.168.56.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_67'
Session ID: 98ef9389e06f7736b7587ecd362729c0
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=C:\Users\ILJA~1.PAV\AppData\Local\Temp\scoped_dir3800_4224}, rotatable
=false, locationContextEnabled=true, version=37.0.2062.103, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false
, nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, takesScreenshot=true}]
at new bot.Error (C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:109:18)
at Object.bot.response.checkResponse (C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\response.js:106:9)
at C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:277:20
at C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:1243:15
at webdriver.promise.ControlFlow.runInNewFrame_ (C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1539:20
)
at notify (C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:362:12)
at notifyAll (C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:331:7)
at resolve (C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:309:7)
at fulfill (C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:429:5)
at C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1406:10
==== async task ====
WebDriver.executeScript()
at webdriver.WebDriver.schedule (C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:268:15)
at webdriver.WebDriver.executeAsyncScript (C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:496:15)
at Protractor.waitForAngular (C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\lib\protractor.js:913:22)
at to.(anonymous function) [as getCurrentUrl] (C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\lib\protractor.js:56:7)
at null.<anonymous> (C:\Users\ilja.pavlovs\Desktop\AngularApp\src\e2e\specs\test.js:28:28)
at C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd\index.js:94:14
at webdriver.promise.ControlFlow.runInNewFrame_ (C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1539:20
)
at webdriver.promise.ControlFlow.runEventLoop_ (C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1404:8)
at wrapper [as _onTimeout] (timers.js:261:14)
==== async task ====
WebDriver.quit()
at webdriver.WebDriver.schedule (C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:268:15)
at webdriver.WebDriver.quit (C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:333:21)
at HostedDriverProvider.teardownEnv (C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\lib\driverProviders\hosted.js:47:16)
at driverprovider_.setupEnv.then.then.then.then.passed (C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:283:35)
at _fulfilled (C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:797:54)
at self.promiseDispatch.done (C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:826:30)
at Promise.promise.promiseDispatch (C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:759:13)
at C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:573:44
at flush (C:\Users\ilja.pavlovs\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:108:17)
So basically it crashes at expect(browser.getCurrentUrl()).toContain('main'); - it was line 28 originally.
In Firefox all works perfectly! I have tried:
extending Jasmine timeout
using Chromedriver without selenium server
running wthout browser.waitForAngular() with browser.waitForAngular() uncommented
using Chromedriver without selenium server
List item
with all kind of different settings
with all kind of different settings protractor 1.2.0 and
1.1.1 versions
I would very appreciate any help with this one!

Resources