protractor

Failed: null value in entry: name=null error while switching Popup window

梦想的初衷 提交于 2020-01-15 05:37:25
问题 I am trying to switch popup window of my AngularJS application. Following is my code: browser.ignoreSynchronization = true; browser.getAllWindowHandles().then(function (handles) { browser.switchTo().window(handles[1]); }); Getting following error: Failed: null value in entry: name=null Stack: UnknownError: null value in entry: name=null 回答1: You might be trying to switch to a new tab before it is actually opened - wait for the window handles count to be more than a desired count with a custom

How to pass command line arguments to the browser driver being used

孤街浪徒 提交于 2020-01-14 14:30:49
问题 I'm currently using protractor for some tests. Unfortunately, I can't figure out a way to pass command line arguments to the actual driver being used. For example, chromedriver.exe accepts '--whitelisted-ips' as a command line argument. Is there any way, in my protractor config, that I can pass this to chromedriver.exe? Another example is, with MicrosoftWebDriver.exe, it has a flag called '--package' which allows me to pass the package id of the app to target. How would I get protractor

Protractor Process exited with error code 100

戏子无情 提交于 2020-01-14 14:07:59
问题 I'm trying to setup protractor on different computer. It is using the same files with my other computer (cannot be used because hdisc corrupted). It run fine on my other computer but I am getting error "Process exited with error code 100" when I tried to run protractor on this one. I've tried to delete the node modules, clean cache and perform npm install again to install the dependencies. It helps my earlier issue (cannot run webdriver) but is now causing me this one. [14:44:09] I/launcher -

Force protractor to wait for seed data to load

﹥>﹥吖頭↗ 提交于 2020-01-13 19:53:12
问题 I have to load some seed data for my tests. I'm having a really hard time making sure the seed data has loaded completely before the tests begin running. In the beforeAll block I'm calling an adapter I wrote for my API that clears out any data, loads a specified file of seed data and then runs a callback passed in from the protractor test file. I can't include the test cases in a callback (this seems like it would be a similar blocking issue to refactoring to promises) or protractor doesn't

Steps for porting protractor test project from javascript to typescript

我与影子孤独终老i 提交于 2020-01-13 19:42:10
问题 installed node and verified npm is working added following to package json "dependencies": {}, "devDependencies": { "@angular/cli": "^7.0.4", "@types/jasmine": "~2.5.45", "@types/jasminewd2": "~2.0.3", "@types/node": "~8.9.4", "jasmine-core": "~2.99.1", "jasmine-reporters": "^2.3.1", "jasmine-spec-reporter": "~4.2.1", "prettier": "1.14.3", "protractor": "~5.3.0", "protractor-beautiful-reporter": "1.2.5", "stylelint": "^9.5.0", "stylelint-config-standard": "^18.2.0", "stylelint-scss": "^3.3.0"

Steps for porting protractor test project from javascript to typescript

孤街醉人 提交于 2020-01-13 19:41:16
问题 installed node and verified npm is working added following to package json "dependencies": {}, "devDependencies": { "@angular/cli": "^7.0.4", "@types/jasmine": "~2.5.45", "@types/jasminewd2": "~2.0.3", "@types/node": "~8.9.4", "jasmine-core": "~2.99.1", "jasmine-reporters": "^2.3.1", "jasmine-spec-reporter": "~4.2.1", "prettier": "1.14.3", "protractor": "~5.3.0", "protractor-beautiful-reporter": "1.2.5", "stylelint": "^9.5.0", "stylelint-config-standard": "^18.2.0", "stylelint-scss": "^3.3.0"

protractor cannot click an element but able to getText

偶尔善良 提交于 2020-01-13 18:53:33
问题 I have a search results page where I'm trying to click on the pagination buttons. I'm able to locate page elements via repeater. I'm also able to get text of the individual page element. But when I click on the page button, the results are different depending on the click method I use. I tried all kinds of click() methods but none work. What else can I try? Here is the code I have: this.clickPageNumber = function(pgNum) { browser.executeScript('window.scrollTo(254,1600);').then(function() {

protractor cannot click an element but able to getText

不打扰是莪最后的温柔 提交于 2020-01-13 18:53:27
问题 I have a search results page where I'm trying to click on the pagination buttons. I'm able to locate page elements via repeater. I'm also able to get text of the individual page element. But when I click on the page button, the results are different depending on the click method I use. I tried all kinds of click() methods but none work. What else can I try? Here is the code I have: this.clickPageNumber = function(pgNum) { browser.executeScript('window.scrollTo(254,1600);').then(function() {

How to run protractor from webapp?

£可爱£侵袭症+ 提交于 2020-01-13 17:04:41
问题 I've some protractor tests (against angularApp) that I would like to run. To do that, i've created an user interface that prompts an user for the script file. Then I need, somehow, make protractor start and run the test. What are my options to achieve this ? 回答1: You can pass the file to your backend (and save it), which then executes the test as you normally would protractor conf.js . If you don't have a backend that can run protractor via node, then you need to fork your own copy of

Protractor closing current tab

为君一笑 提交于 2020-01-13 13:12:34
问题 I have a non-angular page where I need to click on 2 links. When clicking on one of the link that automatically opens in a new tab. Now I switch to new tab and set the browser.ignoreSynchronization = false because the newly opened tab is a angular window; and call one of my test. Once verified. I want to close the current tab and go back to the non-angular page to click on link #2 which would again open in a new tab. I tried window.close but i am getting window is undefined. I used browser