I'm wondering if it is possible to run a setup of angular cli project with cucumber e2e tests, using protractor steps, without using a selenium server. When I search for such configurations, I only find ones that have a seleniumAddress setup.
So, is it possible to run it without it?
Requires a server running W3C WebDriver specifications
From your question, can you run Protractor without a selenium server? Yes, if you are using a browser driver that follows the W3C WebDriver specification. So setting directConnect: true (angular-cli default) in your configuration file basically tells Protractor to launch the driver binary, then Protractor creates a driver provider to talk to that binary.
Driver provider options
The driver providers can be different. Your question also referred to the seleniumAddress. So how does this work? Basically, Protractor reads your configuration file and decides which driver provider to launch. If you are not using directConnect and have decided to use the seleniumAddress option in your configuration then you could be either launching an attached session or a hosted driver. Attaching a session means that you have a previous session running and Protractor will launch tests against the session id. Hosted means that you have started your test against a running selenium standalone server. Usually the selenium standalone server is http://localhost:4444.
There are other types of driver providers to help launch your tests and if you follow the conditional in buildDriverProvider method, you can pick and chose which one you want to launch. Obviously (from the conditional), if you have directConnect and seleniumAddress, you will launch with a direct connect driver provider.
A quick note on webdriver-manager
Also a quick note on webdriver-manager. If you plan to launch your Protractor tests on Firefox, you'll need to download Gecko driver. If you use the seleniumAddress option, you'll also need to download the selenium-standalone server. The angular-cli only downloads chromedriver with the command, webdriver-manager update --standalone false --gecko false. To download the rest, simply remove the flags that are set to false: webdriver-manager update
Cucumber in your configuration
So finally you want cucumber with Protractor. Protractor supports cucumber as a custom framework. You'll need to require the protractor-cucumber-framework. Hopefully you have found this on the configuration in the Protractor-cookbook.
You should add the following to your configuration to get cucumber working:
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
cucumberOpts: {
compiler: "ts:ts-node/register",
monochrome: true,
strict: true,
plugin: ["pretty"],
require: ['../../stepdefinitions/*.ts', '../../support/*.ts'],
//tags help us execute specific scenarios of feature files
tags: '#AddScenario,#SubtractScenario,#MultiplyScenario,#DivideScenario,#ModulusScenario'
}
You can run protractor tests without selenium server by using directConnect: true in your protractor config. But note this option only currently works with Chrome and Firefox.
Related
I am testing REST services using PROTRACTOR-HTTP-CLIENT tool in my protractor framework. The same framework also tests the UI application. I have different config file for UI and API test.
But my problem is when I am testing the REST services the chrome browser is launching which has no use.I can use headless chrome but I want to completely disable the browser launch.
Is there any way to disable the browser launch when testing the rest services.
I don't think this will be achievable. The webdriver session is triggered during one of the automated hook stages during Protractors initialization, likely the onPrepare hook. This hook functionality will always be executed and there is no ability to override it before it takes place.
What you could do is call browser.quit() at the start of your tests to end the session but as far as I know there is no way to stop it from initializing.
I have same setup in my project with typescript. For Api tests I have a separate jasmine.json file and npm script "jasmine-ts --config=jasmine.json". This should help you avoid initializing browser and runs only api tests. Basically instead of using protractor to run tests, running tests directly using jasmine framework.
this is how my jasmine.json file looks:
{
"spec_dir": "specs",
"spec_files": [
"api/*[sS]pec.ts"
],
"helpers": [
"init.ts"
],
"stopSpecOnExpectationFailure": false,
"random": false
}
Oracle Forms 12C has given little pointers for this at https://docs.oracle.com/middleware/12213/formsandreports/deploy-forms/oracle-forms-and-javascript-integration.htm#FSDEP-GUID-F38EE72E-FE26-49C0-AEC6-F5F9F65FBFFF
I have downloaded the Jetty jar and added to the jnlp files so that it could be downloaded to clients PC, however calling java script via WEB.JAVASCRIPT_EVAL_FUNCTION() gives me FRM-41848 JavaScript Execution is disabled during webstart session.
Any Help/Suggestion?
As stated here:
FRM-41848: JavaScript execution is disabled during webstart session.
Cause: JavaScript integration is not supported when running webstart.
Action: Use a browser if you want to run JavaScript integration with Oracle Forms.
Level: 15
Trigger: ON-ERROR
You'll have to run the application through a web browser.
I generated some JMX script from Selenium IDE using Jmeter Plugin for Selenium.
I could able to generate JMX file from IDE and try to run the same in Jmeter. I am getting Unknown host exception in Jmeter.
Do I need to make some special setting in Jmeter?
I don't have any idea what Jmeter Plugin for Selenium is so I would suggest reach out to this plugin developers.
In regards to converting Selenium tests into JMeter, you can just record the test while it is running in the IDE via JMeter's HTTP(S) Test Script Recorder.
Selenium IDE plugin should respect Firefox Proxy Settings so when you run your test in it JMeter will capture the relevant requests and store them in form of HTTP Request samplers.
Another option is using Taurus tool which has Proxy2JMX module allowing conversion of Selenium tests into JMeter .jmx test scripts, as a bonus you will get automatic correlation of dynamic parameters, it means you won't have to work them arround using post-processors, Taurus will do this for you. See How to Convert Selenium Scripts into the JMX Converter article for more details.
Selenium server could not connect
Description : Run the script and In Log table display the error.
Error : Selenium server could not connect, have you started the selenium server.
You should check out this link. Your settings might be trying to use webdriver to connect to a selenium server. You likely do not want this feature on, or you need to specify a valid selenium server. Follow the instructions to open the options dialog:
https://sqa.stackexchange.com/questions/10024/error-could-not-connect-to-selenium-server-have-you-started-the-selenium-server
You're probably in "webdriver playback" mode. There are two ways to
play back tests that were recorded with Selenium IDE: using Selenium
IDE, or using Webdriver. If you're using Webdriver, you have a client
that connects to a server (sometimes a remote server), so you have to
start the server component in order to let the client (Selenium IDE)
connect.
To turn off Webdriver playback, go to the Options dialog, and uncheck
"Enable Webdriver playback". Then restart the browser you're running
Selenium IDE in.
I'm using selenium webdriver to test our website. We also have a browser plugin/extension that we'd like to test in the same way. As far as I can tell there isn't any way to test the installation of a plugin using webdriver. Is there any way to do it with webdriver? If not how might I go about automating testing installation of the plugin?
So it seems firefox and chrome will both allow you to register extensions using webdriver capabilities.
Here is the documentation for
Firefox: https://code.google.com/p/selenium/wiki/FirefoxDriver#Running_with_firebug
Chrome: https://code.google.com/p/selenium/wiki/ChromeDriver#Chrome_Extensions
No support unfortunately, but this is a very good start.