How to make local connections to crossbrowsertesting.com with Protractor? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceHow to align checkboxes and their labels consistently cross-browsersHow to vertically center a div for all browsers?How to disable text selection highlighting?How to style a <select> dropdown with only CSS?How to getText on an input in protractorJasmine-reporters error in angularjs end to end testselenium standalone terminates with unknown errorHow to setup and run angular js protractor test in jenkins?Not able to navigate from Non-angular page to angular page in iframeProtractor is executing onPrepare multiple times in multicapability mode

Slither Like a Snake

3 doors, three guards, one stone

What LEGO pieces have "real-world" functionality?

What to do with post with dry rot?

Why don't the Weasley twins use magic outside of school if the Trace can only find the location of spells cast?

90's book, teen horror

Autumning in love

Antler Helmet: Can it work?

What items from the Roman-age tech-level could be used to deter all creatures from entering a small area?

What's the point in a preamp?

I'm having difficulty getting my players to do stuff in a sandbox campaign

The following signatures were invalid: EXPKEYSIG 1397BC53640DB551

When is phishing education going too far?

Who can trigger ship-wide alerts in Star Trek?

How to say that you spent the night with someone, you were only sleeping and nothing else?

How does modal jazz use chord progressions?

Can a zero nonce be safely used with AES-GCM if the key is random and never used again?

Statistical model of ligand substitution

How are presidential pardons supposed to be used?

Is above average number of years spent on PhD considered a red flag in future academia or industry positions?

How is simplicity better than precision and clarity in prose?

Can I throw a longsword at someone?

How to rotate it perfectly?

Can a non-EU citizen traveling with me come with me through the EU passport line?



How to make local connections to crossbrowsertesting.com with Protractor?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
The Ask Question Wizard is Live!
Data science time! April 2019 and salary with experienceHow to align checkboxes and their labels consistently cross-browsersHow to vertically center a div for all browsers?How to disable text selection highlighting?How to style a <select> dropdown with only CSS?How to getText on an input in protractorJasmine-reporters error in angularjs end to end testselenium standalone terminates with unknown errorHow to setup and run angular js protractor test in jenkins?Not able to navigate from Non-angular page to angular page in iframeProtractor is executing onPrepare multiple times in multicapability mode



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















How can I test my Angular Pages with Protractor in my local network at crosbrowsertesting.com? I installed "npm i cbt_tunnels" and my protractor.conf looks like this:



const cbt = require('cbt_tunnels');
export.config= {
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
directConnect: false,
seleniumAddress: 'http://<myusername>:<mykey>@hub.crossbrowsertesting.com:80/wd/hub',
capabilities :
name : 'protractor test', // this will show up in the UI
// these are important :)
browserName : "firefox",
browser_api_name : 'FF39', // change this according to what browser you are using
os_api_name : 'Win10', // change this for the OS you are using
screen_resolution : '1024x768', // change this for the resolution
record_video : 'true',
record_network : 'true',
record_snapshot : 'true',
acceptInsecureCerts: 'true',
tunnel: 'true'

,
onComplete: () =>
browser.quit();
,

onPrepare()
cbt.start("username": "<myusername>", "authkey":
"<mykey>", function (err)
if (!err) console.log("cbt success");
);



I can see the test running at crossbrowsertesting.com but the browser there says:
waiting for localhost



What is missing?










share|improve this question
























  • you should firstly create a tunnel and then run your tests. Please read how to do it github.com/crossbrowsertesting/cbt-tunnel-nodejs#readme

    – Oleksii
    Mar 8 at 16:39

















1















How can I test my Angular Pages with Protractor in my local network at crosbrowsertesting.com? I installed "npm i cbt_tunnels" and my protractor.conf looks like this:



const cbt = require('cbt_tunnels');
export.config= {
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
directConnect: false,
seleniumAddress: 'http://<myusername>:<mykey>@hub.crossbrowsertesting.com:80/wd/hub',
capabilities :
name : 'protractor test', // this will show up in the UI
// these are important :)
browserName : "firefox",
browser_api_name : 'FF39', // change this according to what browser you are using
os_api_name : 'Win10', // change this for the OS you are using
screen_resolution : '1024x768', // change this for the resolution
record_video : 'true',
record_network : 'true',
record_snapshot : 'true',
acceptInsecureCerts: 'true',
tunnel: 'true'

,
onComplete: () =>
browser.quit();
,

onPrepare()
cbt.start("username": "<myusername>", "authkey":
"<mykey>", function (err)
if (!err) console.log("cbt success");
);



I can see the test running at crossbrowsertesting.com but the browser there says:
waiting for localhost



What is missing?










share|improve this question
























  • you should firstly create a tunnel and then run your tests. Please read how to do it github.com/crossbrowsertesting/cbt-tunnel-nodejs#readme

    – Oleksii
    Mar 8 at 16:39













1












1








1








How can I test my Angular Pages with Protractor in my local network at crosbrowsertesting.com? I installed "npm i cbt_tunnels" and my protractor.conf looks like this:



const cbt = require('cbt_tunnels');
export.config= {
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
directConnect: false,
seleniumAddress: 'http://<myusername>:<mykey>@hub.crossbrowsertesting.com:80/wd/hub',
capabilities :
name : 'protractor test', // this will show up in the UI
// these are important :)
browserName : "firefox",
browser_api_name : 'FF39', // change this according to what browser you are using
os_api_name : 'Win10', // change this for the OS you are using
screen_resolution : '1024x768', // change this for the resolution
record_video : 'true',
record_network : 'true',
record_snapshot : 'true',
acceptInsecureCerts: 'true',
tunnel: 'true'

,
onComplete: () =>
browser.quit();
,

onPrepare()
cbt.start("username": "<myusername>", "authkey":
"<mykey>", function (err)
if (!err) console.log("cbt success");
);



I can see the test running at crossbrowsertesting.com but the browser there says:
waiting for localhost



What is missing?










share|improve this question
















How can I test my Angular Pages with Protractor in my local network at crosbrowsertesting.com? I installed "npm i cbt_tunnels" and my protractor.conf looks like this:



const cbt = require('cbt_tunnels');
export.config= {
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
directConnect: false,
seleniumAddress: 'http://<myusername>:<mykey>@hub.crossbrowsertesting.com:80/wd/hub',
capabilities :
name : 'protractor test', // this will show up in the UI
// these are important :)
browserName : "firefox",
browser_api_name : 'FF39', // change this according to what browser you are using
os_api_name : 'Win10', // change this for the OS you are using
screen_resolution : '1024x768', // change this for the resolution
record_video : 'true',
record_network : 'true',
record_snapshot : 'true',
acceptInsecureCerts: 'true',
tunnel: 'true'

,
onComplete: () =>
browser.quit();
,

onPrepare()
cbt.start("username": "<myusername>", "authkey":
"<mykey>", function (err)
if (!err) console.log("cbt success");
);



I can see the test running at crossbrowsertesting.com but the browser there says:
waiting for localhost



What is missing?







protractor cross-browser






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 10 at 8:08







asdfsafd

















asked Mar 8 at 15:04









asdfsafdasdfsafd

815




815












  • you should firstly create a tunnel and then run your tests. Please read how to do it github.com/crossbrowsertesting/cbt-tunnel-nodejs#readme

    – Oleksii
    Mar 8 at 16:39

















  • you should firstly create a tunnel and then run your tests. Please read how to do it github.com/crossbrowsertesting/cbt-tunnel-nodejs#readme

    – Oleksii
    Mar 8 at 16:39
















you should firstly create a tunnel and then run your tests. Please read how to do it github.com/crossbrowsertesting/cbt-tunnel-nodejs#readme

– Oleksii
Mar 8 at 16:39





you should firstly create a tunnel and then run your tests. Please read how to do it github.com/crossbrowsertesting/cbt-tunnel-nodejs#readme

– Oleksii
Mar 8 at 16:39












1 Answer
1






active

oldest

votes


















0














As the commenter noted, you need to start the local connection before you can actually use the local connection feature.



In this case, you will want to use this line:
'cbt.start("username":"USERNAME","authkey":"AUTHKEY",function(err) if(!err) do stuff )'
from the documentation; this will allow you to automatically start the test once the local connection has been set up correctly.



In this case, do stuff is everything to run your tests (scaffolding/setup can be done externally).



Something like this is what you're really after



const cbt = require('cbt_tunnels');
cbt.start("username":"USERNAME","authkey":"AUTHKEY",
function(err)
if(!err) do stuff
);


Edit:
It looks like you want to start the tunnel in beforeLaunch, instead of in onPrepare, and it needs to be set as a promise. Something like this:



 beforeLaunch: () => 
return new Promise( (resolve, reject) =>
cbt.start("username": "<your email here>", "authkey": "<your auth here>", function (err)
if (!err)
console.log("cbt success");
return resolve();

return reject(err);
);
)






share|improve this answer

























  • Thank you, sorry, my snippet above wasn't complete, I updated it. I do have the cbt.start, but my test cases don't happen inside the callback.

    – asdfsafd
    Mar 10 at 8:03











  • I notice that your post now contains a console.log - does this appear at all when you attempt to run the test?

    – Harold Schreckengost
    Mar 10 at 17:04











  • Using the promise solved it for me

    – asdfsafd
    Mar 12 at 7:18












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55065916%2fhow-to-make-local-connections-to-crossbrowsertesting-com-with-protractor%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














As the commenter noted, you need to start the local connection before you can actually use the local connection feature.



In this case, you will want to use this line:
'cbt.start("username":"USERNAME","authkey":"AUTHKEY",function(err) if(!err) do stuff )'
from the documentation; this will allow you to automatically start the test once the local connection has been set up correctly.



In this case, do stuff is everything to run your tests (scaffolding/setup can be done externally).



Something like this is what you're really after



const cbt = require('cbt_tunnels');
cbt.start("username":"USERNAME","authkey":"AUTHKEY",
function(err)
if(!err) do stuff
);


Edit:
It looks like you want to start the tunnel in beforeLaunch, instead of in onPrepare, and it needs to be set as a promise. Something like this:



 beforeLaunch: () => 
return new Promise( (resolve, reject) =>
cbt.start("username": "<your email here>", "authkey": "<your auth here>", function (err)
if (!err)
console.log("cbt success");
return resolve();

return reject(err);
);
)






share|improve this answer

























  • Thank you, sorry, my snippet above wasn't complete, I updated it. I do have the cbt.start, but my test cases don't happen inside the callback.

    – asdfsafd
    Mar 10 at 8:03











  • I notice that your post now contains a console.log - does this appear at all when you attempt to run the test?

    – Harold Schreckengost
    Mar 10 at 17:04











  • Using the promise solved it for me

    – asdfsafd
    Mar 12 at 7:18
















0














As the commenter noted, you need to start the local connection before you can actually use the local connection feature.



In this case, you will want to use this line:
'cbt.start("username":"USERNAME","authkey":"AUTHKEY",function(err) if(!err) do stuff )'
from the documentation; this will allow you to automatically start the test once the local connection has been set up correctly.



In this case, do stuff is everything to run your tests (scaffolding/setup can be done externally).



Something like this is what you're really after



const cbt = require('cbt_tunnels');
cbt.start("username":"USERNAME","authkey":"AUTHKEY",
function(err)
if(!err) do stuff
);


Edit:
It looks like you want to start the tunnel in beforeLaunch, instead of in onPrepare, and it needs to be set as a promise. Something like this:



 beforeLaunch: () => 
return new Promise( (resolve, reject) =>
cbt.start("username": "<your email here>", "authkey": "<your auth here>", function (err)
if (!err)
console.log("cbt success");
return resolve();

return reject(err);
);
)






share|improve this answer

























  • Thank you, sorry, my snippet above wasn't complete, I updated it. I do have the cbt.start, but my test cases don't happen inside the callback.

    – asdfsafd
    Mar 10 at 8:03











  • I notice that your post now contains a console.log - does this appear at all when you attempt to run the test?

    – Harold Schreckengost
    Mar 10 at 17:04











  • Using the promise solved it for me

    – asdfsafd
    Mar 12 at 7:18














0












0








0







As the commenter noted, you need to start the local connection before you can actually use the local connection feature.



In this case, you will want to use this line:
'cbt.start("username":"USERNAME","authkey":"AUTHKEY",function(err) if(!err) do stuff )'
from the documentation; this will allow you to automatically start the test once the local connection has been set up correctly.



In this case, do stuff is everything to run your tests (scaffolding/setup can be done externally).



Something like this is what you're really after



const cbt = require('cbt_tunnels');
cbt.start("username":"USERNAME","authkey":"AUTHKEY",
function(err)
if(!err) do stuff
);


Edit:
It looks like you want to start the tunnel in beforeLaunch, instead of in onPrepare, and it needs to be set as a promise. Something like this:



 beforeLaunch: () => 
return new Promise( (resolve, reject) =>
cbt.start("username": "<your email here>", "authkey": "<your auth here>", function (err)
if (!err)
console.log("cbt success");
return resolve();

return reject(err);
);
)






share|improve this answer















As the commenter noted, you need to start the local connection before you can actually use the local connection feature.



In this case, you will want to use this line:
'cbt.start("username":"USERNAME","authkey":"AUTHKEY",function(err) if(!err) do stuff )'
from the documentation; this will allow you to automatically start the test once the local connection has been set up correctly.



In this case, do stuff is everything to run your tests (scaffolding/setup can be done externally).



Something like this is what you're really after



const cbt = require('cbt_tunnels');
cbt.start("username":"USERNAME","authkey":"AUTHKEY",
function(err)
if(!err) do stuff
);


Edit:
It looks like you want to start the tunnel in beforeLaunch, instead of in onPrepare, and it needs to be set as a promise. Something like this:



 beforeLaunch: () => 
return new Promise( (resolve, reject) =>
cbt.start("username": "<your email here>", "authkey": "<your auth here>", function (err)
if (!err)
console.log("cbt success");
return resolve();

return reject(err);
);
)







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 11 at 16:09

























answered Mar 9 at 23:50









Harold SchreckengostHarold Schreckengost

164




164












  • Thank you, sorry, my snippet above wasn't complete, I updated it. I do have the cbt.start, but my test cases don't happen inside the callback.

    – asdfsafd
    Mar 10 at 8:03











  • I notice that your post now contains a console.log - does this appear at all when you attempt to run the test?

    – Harold Schreckengost
    Mar 10 at 17:04











  • Using the promise solved it for me

    – asdfsafd
    Mar 12 at 7:18


















  • Thank you, sorry, my snippet above wasn't complete, I updated it. I do have the cbt.start, but my test cases don't happen inside the callback.

    – asdfsafd
    Mar 10 at 8:03











  • I notice that your post now contains a console.log - does this appear at all when you attempt to run the test?

    – Harold Schreckengost
    Mar 10 at 17:04











  • Using the promise solved it for me

    – asdfsafd
    Mar 12 at 7:18

















Thank you, sorry, my snippet above wasn't complete, I updated it. I do have the cbt.start, but my test cases don't happen inside the callback.

– asdfsafd
Mar 10 at 8:03





Thank you, sorry, my snippet above wasn't complete, I updated it. I do have the cbt.start, but my test cases don't happen inside the callback.

– asdfsafd
Mar 10 at 8:03













I notice that your post now contains a console.log - does this appear at all when you attempt to run the test?

– Harold Schreckengost
Mar 10 at 17:04





I notice that your post now contains a console.log - does this appear at all when you attempt to run the test?

– Harold Schreckengost
Mar 10 at 17:04













Using the promise solved it for me

– asdfsafd
Mar 12 at 7:18






Using the promise solved it for me

– asdfsafd
Mar 12 at 7:18




















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55065916%2fhow-to-make-local-connections-to-crossbrowsertesting-com-with-protractor%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved