Protractor 5.1.1 selenium-webdriver version inconsitency - selenium

I've recently upgraded to Protractor 5.1.1 and am facing some issues when setting cookies via browser.manage().addCookie()
The API has changed between versions 2 and 3 of Selenium-webdriver to expect an object rather than the previous 2..6 arguments. When I make the changes to my code to use the object, the typescript compiler complains saying that it expects 2..6 arguments.
old api:
browser.manage().addCookie('cookieName', 'cookieVal');
new api:
browser.manage().addCookie({name:'cookieName', value: 'cookieVal'});
I think this is because the #types/selenium-webdriver in the package.json of protractor v5.1.1 is pointing at version 2.53.39. The version of the actual selenium-webdriver the same package.json is referencing is 3.0.1.
Should this be the same value? Is anyone else experiencing problems with this?

Yup, this is happening because the type definitions was not written at the time.
workaround
Here is the workaround for now:
(browser.manage() as any).addCookie({name:'cookieName', value: 'cookieVal'});
We are setting browser.manage returned options object to any. Then we can give it the addCookie method.
OR
upgrade definitions
you could upgrade your #types/selenium-webdriver type definitions to version 3.

I'm having the same problem! I do know that the #types/selenium-driver is now updated to version 3.0.0.
I haven't had luck with this, but you could try installing it directly (i.e. npm install --save-dev #types/selenium-webdriver) and adding it to your list of types in your tsconfig.json file (i.e. types: [ "selenium-webdriver" ].

Related

Karate Version Upgrade config.js is not picking "classpath"

I am upgrading from 0.9.6.RC4 to 1.0.1 version or higher
I have below script in config.js
karate.configure("ssl", {keystore :'classpath:api/FeatureFiles/UAT.jks,keyStorePassword:'test',keyStoreType:'jks'})
This isn't getting picked and always return path cannot be found. I tried changing "classpath:" to "file:" also as I saw in some previous issues related to this in github.
How can I solve this?

Which version of marionette_driver with Firefox 52.9.0esr (Tor Browser 7.5.6)

The Tor Browser updated to 7.5.6. The previously working code failed with
InvalidSessionIdException:
After updating to marionette_driver 2.7, the call to client.start_session() failed with
marionette_driver.errors.UnknownCommandException: WebDriver:NewSession
Which version of the marionette_driver should be used with this Firefox version? (Or maybe another framework like Selenium?)
Since there are only a few version at Pypi, and no other answer seems to exist, just try them all starting with the current one.
It worked with version 2.5:
pip2 install marionette_driver==2.5
UPDATE: The InvalidSessionIdException returned. To fix this, call client.start_session() again (it can be called when catching the exception in a try-block)

Protractor/Jasmine showing different versions - what am I doing wrong?

When I do this:
console.log('jasmine-version:' + jasmine.getEnv().versionString());
it prints: jasmine-version:1.3.1 revision 1354556913
When I run 'npm list jasmine-core' it prints:
server#0.0.1 /Users/xx/Desktop/workingDirectory
└── jasmine-core#2.1.3
Why is one showing 2.1.3 and another showing 1.3.1?
I don't seem to have the features in 2.1.3, so it's running 1.3.1. How do I fix this?
You have to specify that you want to use jasmine2 in the conf file. Please read the docs here: https://github.com/angular/protractor/blob/master/docs/jasmine-upgrade.md#in-your-conf-file.
Protractor supports both jasmine 1.3 and 2.x, and it's up to you to specify the version of jasmine you want to use. (Side note, 2.x is provided via jasmine-core, while 1.3 is provided via minijasminenode)
EDIT: another side note, protractor support for 2.x is not released until protractor 1.6 or if you use master
This is my issue https://github.com/angular/protractor/issues/362
Looks like Jasmine2 was only checked in a few days ago.

Travis-CI not being able to load tv4

My project was passing on Travis till my last commit. After this commit, Travis says:
Error: Cannot find module 'tv4' (at https://travis-ci.org/a85/Newman/builds/37216427#L141)
It has installed tv4#1.1.3 as part of the build (as seen at https://travis-ci.org/a85/Newman/builds/37216427#L40)
In version 1.1.3 of tv4, the name field in package.json is "tv4" (https://github.com/geraintluff/tv4/commit/4887d0f073951db681d23b9fde69ed7a9092fdea), so I guess it's not a case issue.
I've tried rebuilding a number of times, but it hasn't helped. Running grunt test locally works perfectly.
Any ideas?
I have the same issue, but i managed to fix this when i changed package.json to the following:
{"main": "tv4.js"}
Instead of
{"main": "tv4.min.js"}
If you take a look at:
https://github.com/geraintluff/tv4/issues/157

Can't get PhantomJS to work with a simple example

I've downloaded the executable and created a simlink to /usr/local/bin.
I'm under Mac OSX 10.7
When I then try to run a script that requires some module i.e.
var page = require('webpage').create();
I got an error
undefined:0 ReferenceError: Can't find variable: require
as if 'require' is not seen as a reserved word but interpreted as a variable symbol.
(As an aside, whenever I lunch phantomjs a Sencha Touch icon appears in my Dock)
Your copy of PhantomJS is from an older version. Always get the latest one from http://phantomjs.org.
I had this issue too, and the problem was my version of mocha -- going back to 1.9.0 fixed it.
SenchaTouch 2.0 installs PhantomJS 1.1 somewhere depending on the OS. Under *NIX check where with 'which phantomjs'.
Just modify your bash or whatever configuration file accordingly to remove the Phantomjs included with SenshaTouch from your PATH.