Giter Site home page Giter Site logo

Comments (17)

juliemr avatar juliemr commented on May 5, 2024

I haven't played with this on Windows yet, so it's possible that this is a windows-specific issue. The changes you made to the configuration file look fine to me. I've pushed a commit that might help with this.

from protractor.

calystoramesh avatar calystoramesh commented on May 5, 2024

still problem before open the browser . all testcases are trying to execute . then browser opened .. getting error in

timers.js:103
if (!process.listeners('uncaughtException').length) throw e;
^
UnknownError: Bad request

Command duration or timeout: 1.50 seconds
Build info: version: '2.33.0', revision: '4e90c97', time: '2013-05-22 15:32:38'
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.7.0_17'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
at new bot.Error (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:108:18)
at Object.bot.response.checkResponse (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\response.js:106:9)
at C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:133:20
at C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:1112:15
at webdriver.promise.ControlFlow.runInNewFrame_ (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1431:20)
at notify (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:315:12)
at notifyAll (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:284:7)
at fulfill (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:389:7)
at C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:600:51
at C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\http\http.js:96:5
==== async task ====
WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:131:49)
at Function.webdriver.WebDriver.createSession (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:110:30)
at Builder.build (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\builder.js:70:22)
at startJasmineTests (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\lib\cli.js:98:45)
at run (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\lib\cli.js:77:5)
at Object. (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\lib\cli.js:156:1)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)

Process finished with exit code 1

added in to following statement in to "onProtractor.js"

describe('angularjs homepage', function() {
this.timeout(80000);
var ptor ;
ptor = protractor.getInstance();

beforeEach(function() {
    ptor.get('../index.html#/form');
});

from protractor.

juliemr avatar juliemr commented on May 5, 2024

I've tried the examples on windows and I can't reproduce your problem - possibly it's related to windows XP?

from protractor.

juliemr avatar juliemr commented on May 5, 2024

Hi,

Closing this as obsolete, please reopen if you're still having issues.

from protractor.

DOwen55 avatar DOwen55 commented on May 5, 2024

Hi,
I'm having the exact same issue as described above. I'm also very new to this framework, but I believe I have everything configured correctly. Running the sample test on Windows 7 (using the following command to start the test process: node lib/cli.js conf.js) and using Chrome I've found that the first test in the suite fails as the browser hosted in selenium is still coming online. Once the browser is up, all subsequent tests run successfully.

The error message provided at the end of the test is: "timeout: timed out after 5000 msec waiting for spec to complete"

Switching the test to IE loads the browser up fast enough to catch the first test and all tests run successfully.

When I tried to apply this to my own project with only the lib_spec file, I found that the entire test ran before the browser could launch (0.07 seconds). The browser does launch a second or so later and looks like it's attempting to display the target app, but selenium shut's it down before the page can be loaded. In this case, the error message is: "TypeError: Cannot call method 'get' of undefined." at line 21, which is:
ptor.get('quizangular/index.html');

The final output on the test is: "3 tests, 3 assertions, 2 failures" so it looks like the first test in the file ran successfully. In this case, switching from Chrome to IE still causes the same delay and test failure.

Please let me know if you need any additional information and thanks for any help you can provide.

from protractor.

juliemr avatar juliemr commented on May 5, 2024

Reopening this issuing and closing #43

For your own project, do you have the following lines?

require('protractor/jasminewd');
ptor = protractor.getInstance();

As for the slowness, sounds like that might just be a webdriver on IE issue. Any idea if this same slowness occurs with a webdriverjs test that doesn't use protractor? e.g. just a file that does

var selenium = require('selenium-webdriver');
var driver = new webdriver.Builder().
      usingServer('http://localhost:4444/wd/hub').
      withCapabilities({
        'browserName': 'chrome',
        'version': '',
        'platform': 'ANY',
        'javascriptEnabled': true
      }).build();
driver.get('<your server>');

from protractor.

DOwen55 avatar DOwen55 commented on May 5, 2024

Hi,
No, I was missing the require and protractor instantiation logic. Thank you. Once I added them to the spec, my tests began to run. However, it is still failing the first test due to a time out.

Note that all this behavior is exhibited using the Chrome driver, not the IE driver. After fixing the file, switching to the IE driver does not exhibit this behavior. All tests from my spec ran successfully!

Here is my spec file:

var protractor = require('../lib/protractor.js');
var util = require('util');
require('../jasminewd');

describe('no ptor at all', function() {
  it('should still do normal tests', function() {
    expect(true).toBe(true);
  });
});

describe('protractor library', function() {
  var ptor = protractor.getInstance();

  it('should wrap webdriver', function() {
    ptor.get('index.html');
    expect(ptor.getTitle()).toEqual('Quiz Angular');
  });

  it('should allow a mix of using protractor and using the driver directly',
    function() {
      ptor.get('index.html');
      expect(ptor.getCurrentUrl()).
          toEqual('http://localhost:8000/quizangular/index.html')

    });
});

The test results are as follows:

F . .
Failures:
1)  no ptor at all should still do normal tests
Message:
    Timeout: timed out after 5000 msec waiting for spec to complete
Stacktrace:
    Undefined
Finished in 10.16 seconds
3 tests, 4 assertions, 1 failure

As for the simple webdriverjs as a spec file, it appears to exhibit the same behavior. I took the sample you provided and loaded it as a spec with no additional tests (though I had to rename the first variable to webdriver). The test completes successfully in 0.001 seconds, and the browser loads immediately after. Was this how you intended me to test it?

Adding the following test logic produces the same behavior:

describe('no ptor at all', function() {
  it('should still do normal tests', function() {
    expect(true).toBe(true);
  });
});

from protractor.

ToddRB avatar ToddRB commented on May 5, 2024

I'm having trouble similar to the original issue above.
When I run protractor myConfig.js, it starts up the selenium server, then tries to run my first spec.

require('protractor/jasminewd');
ptor = protractor.getInstance();

My spec has the above lines, but when I call ptor.get('/'), it says 'Cannot call method of 'get' undefined at null.

from protractor.

juliemr avatar juliemr commented on May 5, 2024

I've fixed a couple issues with timeout behavior - any issues remaining after 0.8.0?

from protractor.

ToddRB avatar ToddRB commented on May 5, 2024

I can't start my tests with
protractor myConfig.js

I need to run it as
node node_modules\protractor\lib\cli.js myConfig.js.

Then it works.

from protractor.

juliemr avatar juliemr commented on May 5, 2024

I'm going to assume this is a windows issue. Will get my hands on one and do some tests.

from protractor.

calystoramesh avatar calystoramesh commented on May 5, 2024

@ DOwen55 : can you please provide you same examples completely . Still I have an problem to run the protractor in chrome also

from protractor.

DOwen55 avatar DOwen55 commented on May 5, 2024

Success! I've downloaded the latest version, installed all the necessary packages and can now confirm that both Chrome & IE run all tests after the browser has loaded. Protractor is now waiting for the browser to start. Thank you!

calystoramesh, I'm not sure what samples you're looking for. I reported these issues using all the samples and test code included in the protractor package available here. The only modification I made was to add the spec file described above.

from protractor.

calystoramesh avatar calystoramesh commented on May 5, 2024

Today, I started Setup the Protractor ,

Step 1: npm install -g protractor (Version 0.9.0)
Step 2: Directly download "selenium-server-standalone-2.33.0.jar" from selenium website
Step 3: Directly download "chrome browser " from Google website
Step 4: Set up the environment variable in system level "webdriver.chrome.driver = c:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium\chromedriver.exe"
Step 5: configure the jobs in Webstrom
conf

step 6 : run selenium server "
E:\protractor>java -jar selenium-server-standalone-2.33.0.jar"

Step 7: run the Protractor conf file

getting error :
"C:\Program Files\nodejs\node.exe" "C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\bin\protractor" example\protractorConf.js
Using the selenium server at http://localhost:4444/wd/hub

C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1542
throw error;
^
UnknownError: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see http://code.google.com/p/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://code.google.com/p/selenium/downloads/list
at new bot.Error (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:109:18)
at Object.bot.response.checkResponse (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\response.js:106:9)
at C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:133:24
at C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:1178:15
at webdriver.promise.ControlFlow.runInNewFrame_ (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1438:20)
at notify (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:328:12)
at notifyAll (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:297:7)
at fulfill (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:402:7)
at C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:1178:15
at webdriver.promise.ControlFlow.runInNewFrame_ (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1438:20)
==== async task ====
WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:130:49)
at Function.webdriver.WebDriver.createSession (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:110:30)
at Builder.build (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\node_modules\selenium-webdriver\builder.js:105:20)
at startJasmineTests (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\lib\cli.js:146:45)
at run (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\lib\cli.js:113:5)
at Object. (C:\Documents and Settings\sweet\Application Data\npm\node_modules\protractor\lib\cli.js:249:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)

Process finished with exit code 8

please help me to set up the protractor

NOTE : NO CHANGE IN "protractorConf.js"

// An example configuration file.
exports.config = {
// The address of a running selenium server.
seleniumAddress: 'http://localhost:4444/wd/hub',

// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'Chrome'
},

// Spec patterns are relative to the current working directly when
// protractor is called.
specs: ['onProtractorRunner.js'],

// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true
}
};

from protractor.

ToddRB avatar ToddRB commented on May 5, 2024

@calystoramesh In your step number 6, I believe that you need to provide the selenium jar file with the browser driver (you set the path for chrome driver, and the error is looking for iedriver). Like this:
java -jar node_modules/selenium/selenium-server-standalone-2.35.0.jar -Dwebdriver.ie.driver=node_modules\selenium\IEDriverServer\IEDriverServer.exe

Also, this can be configured in the protractorConf.js file. Here is youtube vid that helped me get started:
http://www.youtube.com/watch?v=UYVcY9EJcRs
This walks through the config file setup, and running the tests.

from protractor.

juliemr avatar juliemr commented on May 5, 2024

Closing this again as obsolete.

from protractor.

calvinKG avatar calvinKG commented on May 5, 2024

HI,

Am experiencing the same problem.

var template = new Error(this.message);
^
UnknownError: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html
at new bot.Error (c:\Users\qxl5048\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:108:18)
at Object.bot.response.checkResponse (c:\Users\qxl5048\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\response.js:109:9)
at c:\Users\qxl5048\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:160:24
at [object Object].promise.Promise.goog.defineClass.invokeCallback_ (c:/Users/qxl5048/AppData/Roaming/npm/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:1337:14)
at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort_.error.executeNext_.execute_ (c:/Users/qxl5048/AppData/Roaming/npm/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2776:14)
at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort_.error.executeNext_ (c:/Users/qxl5048/AppData/Roaming/npm/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2758:21)
at goog.async.run.processWorkQueue (c:\Users\qxl5048\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\async\run.js:124:15)
at process.tickCallback (node.js:401:9)
From: Task: WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession
(c:\Users\qxl5048\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:157:22)
at Function.webdriver.WebDriver.createSession (c:\Users\qxl5048\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:131:30)
at [object Object].Builder.build (c:\Users\qxl5048\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\builder.js:445:22)
at [object Object].DriverProvider.getNewDriver (c:\Users\qxl5048\AppData\Roaming\npm\node_modules\protractor\lib\driverProviders\driverProvider.js:38:7)
at [object Object].Runner.createBrowser (c:\Users\qxl5048\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:186:37)
at c:\Users\qxl5048\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:276:21
at _fulfilled (c:\Users\qxl5048\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:797:54)
at self.promiseDispatch.done (c:\Users\qxl5048\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:826:30)
at Promise.promise.promiseDispatch (c:\Users\qxl5048\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:759:13)
at c:\Users\qxl5048\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:525:49
[launcher] Process exited with error code 1

from protractor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.