I'm trying to run tests with a custom firefox profile.my idea is to
use 2 firefox versions in my machine .one with firefox template &
other without it ,so we used
*custom "C:/Program Files (x86)/UtiluMFC/Mozilla Firefox 3.6/
firefox.exe" in setup from code
if i use custom some extra parameters are passing in url like below in
browser ,
selenium-server/core/RemoteRunner.html?
sessionId=dc91ae43b4754f87a25d4718feeb&multiWindow=true&baseUrl=http%3A
%2F%2Ftest.com&debugMode=false
Note : i have not started the server from command prompt i have used
in java ,but havnt set any firefox template in code.same worked in
linux of i use * firefox instead of * custom
Am i missing some thing?
The question is not that clear - what do you mean by template?
If you want to run with two different Firefox profiles, don't use *custom - rather use *firefox and change the profile as per this post:
Selenium RC : Setting up a Firefox proxy
I think I am strougling with the same and I believe one has to set the proxy settings in the custom firefox to make it work. Did you try that?
Or did you just want to use a profile TEMPLATE in which case you could pass the -firefoxProfileTemplate in your command to start the JAVA server, like so:
java -jar selenium-server.jar -firefoxProfileTemplate "/path/to/profile/"
In the second case, if you use *firefox, your profile will automatically be selected.
Related
I have a Chrome app that I created with "Create Application Shortcut".
What I need is to open that app with specific url on the same domain.
Example:
chrome_proxy.exe --profile-directory=Default --app-id=xxxxxxxx "https://www.google.com"
Is that possible or any command that achive the same result?
I'm guessing you installed the Chrome app so that the website launches in a standalone window. If this is the case, you can achieve something similar by using the --app command line switch instead.
Eg: chrome_proxy.exe --profile-directory=Default --app="https://www.google.com"
This doesn't strictly open the URL in the existing app, but it does open that specific URL in a standalone window.
Here's the answer what you are looking for.
chrome_proxy.exe --profile-directory=Default --app-id=xxxxxxxx --app-launch-url-for-shortcuts-menu-item="https://youtu.be/dQw4w9WgXcQ"
Using this will work:
chrome_proxy.exe --profile-directory=Default --app-id=xxxxxxxx --app-launch-url-for-shortcuts-menu-item="https://youtu.be/dQw4w9WgXcQ"
It will launch in the special standalone window AND navigate to the specified URL.
Replace xxxxxxxx with the app id (this can be found if you look at the properties of the shortcut it created), but after you create the app this part should already be filled in.
At that point all you need to add is this part:
--app-launch-url-for-shortcuts-menu-item="https://youtu.be/dQw4w9WgXcQ"
Replacing the https://youtu.be/dQw4w9WgXcQ part with the full URL of where you would like to navigate to.
Documentation of the argument can be found here.
Credit due in part to 김보근.
right I have hit a wall using the Selenium Maven Plugin - using the selenese goal which is all swell - however when it comes to executing the tests in firefox, the plugin launches a fresh firefox profile, which doesn't have the company proxy configured.
Now if i were simply executing my html suite directly with the selenium server jar I could specify a firefox profile - however it appears to be the case this has not been included in as a parameter in the selenese goal for this plugin. madness!
there are such parameters for the start-server goal, so why not selenese?
Has anybody else faced this issue? Any workarounds?
Appreciate all sensible input.
Thanks,
I thought I would post my solution should anyone else come accross this...
Simply need to get the selenium maven plugin source, and patch it. The constants are available in the selenium server RemoteControlConfiguration class however this plugin doesn't make use of them all in the SeleneseMojo. So it is a very simple fix:
Set the properties that we want to change when the seleneseMojo starts the selenium server. So in this case I wanted to make use of firefoxProfileTemplate so I did this:
def conf = new RemoteControlConfiguration()
conf.port = port
conf.singleWindow = !multiWindow
conf.firefoxProfileTemplate = firefoxProfileTemplate
def server = new SeleniumServer(slowResources, conf)
server.start()
Now I can specify a firefoxProfileTemplate value in my maven project execution configurations and therefore specify a firefox profile when running selenium html suites through maven.
The problem: toggle javascript support without restarting firefox (nor resorting to different driver) during cucumber test run.
If Firefox's prefutils were exposed to javascript in a web page, that would make it possible. But it is not the case.
So, is there a plugin that does it? Or is there another way to solve the problem? Or is there a good tutorial (that highlights the exposing bit) on how to make such a plugin?
Edit
On a second thought, how would javascript be of any help once it is disabled? Probably the whole idea is a bit screwed.
I assume that your tests run with normal web content privileges. In that case, they aren't going to be able to affect browser settings such as whether JavaScript is enabled (I assume that's what you mean by "toggle JavaScript support").
I'd implement a simple XPCOM component with a method to turn JS support on and off (by setting the appropriate pref). You can expose it as a JavaScript global property so that your tests can access it. See Expose an XPCOM component to javascript in a web page for more details. Package your component in an extension and make sure it is installed in the Firefox instance where your tests are running.
If you want to access the preferences API directly from your content script, you can add the following prefs to Firefox, either in about:config or by adding the following lines to prefs.js in your profile directory:
user_pref("capability.principal.codebase.p1.granted", "UniversalXPConnect UniversalBrowserRead UniversalBrowserWrite UniversalPreferencesRead UniversalPreferencesWrite UniversalFileRead");
user_pref("capability.principal.codebase.p1.id", "http://www.example.com");
user_pref("capability.principal.codebase.p1.subjectName", "");`
user_pref("signed.applets.codebase_principal_support", true);
Replace www.example.com with the domain that you want to grant the privileges to. Also add this line to your JS code before you call the preferences API:
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
A local file (something loaded from file:///) is allowed to request additional privileges. Normally you would get a prompt asking whether you want to allow access - you can "auto-accept" the prompt by adding the following lines to prefs.js in the Firefox profile:
user_pref("capability.principal.codebase.p0.granted", "UniversalXPConnect");
user_pref("capability.principal.codebase.p0.id", "file://");
user_pref("capability.principal.codebase.p0.subjectName", "");
You page can then do:
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var branch = Components.classes["#mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
branch.setBoolPref("javascript.enabled", false);
This will definitely work if your page is a local file. Judging by the error message however, you are currently running code from about:blank. It might be that changing capability.principal.codebase.p0.id into about:blank or into moz-safe-about:blank will allow that page to get extended privileges as well but I am not sure.
However, none of this will really help if JavaScript is already disabled and you need to enable it. This can only be solved by writing an extension and adding it to the test profile. JavaScript in Firefox extensions works regardless of this setting.
That means you need Javascript to toggle enabling or disabling Javascript.
function setJavascriptPref(bool) {
prefs = Components.classes["#mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
prefs.setBoolPref("javascript.enabled", bool);
}
Recorded my case in Badboy and exported to jmeter which is saved in desktop. Now how to use this script in jmeter ?
Run JMETER_HOME/bin/jmeter.bat and use File> Open the JMX script recorded via Badboy.
It works!
Like joseK said, you just have to open it via your File/Open Menu in jmeter ...
Or you mean that you've opend it and its not working, in that case you might have some change to do in your exported jmeter test.
Here some problem I got using badboy :
on our apps, badboy seem to add get request that didn't work at all, We had to remove them manually in order to fix the problem.
And if you have a token or session id that you need to extract from your cookies or http response, it's doesn't take care of it for you so you got to figure out how to extract them with a reg-ex extrator and put in a variable that your test will use.
See this link - could be a compatibility problem, if you are running jmeter 2.4 (badboy exports do not work with 2.4 yet). You might have to download 2.3.4 in order to convert the badboy script into a version compatible with 2.4
http://www.pukkared.com/2011/06/using-badboy-to-build-jmeter-test-plans-over-an-ssl/
I've already read posts like Passing PHP arguments into NetBeans into a page that features symfony url-routing
but I cannot make things work.
I would like to run the following page:
http://localhost/s/web/frontend_dev.php/travel
So I tried first the "Local Website Configuration" with Netbeans 6.9.1. As stated in the linked thread there is an issue here since I can point to the project url and to the "web/frontend_dev.php" index file but I am not able to have "/travel" as an argument since Netbeans always prefixes it with ? for parameter passing which I don't want.
I the mentioned thread the solution is supposed to be using the Script Config option. Fine
I can point to php.exe and I can point to the index file again at web/frontend_dev.php but although I can pass arguments like /travel there it still does not work since it creates a whitespace in the call:
php.exe ./web/frontend_dev.php /travel
which does not work either.
It is easier to use the following:
Set the Debug URL to "Do not open Webbrowser" (Project->Properties->Run Configuration->Advanced)
Start the debugging session with Netbeans (Netbeans doesn't start a browser but waits for a XDebug connection)
Use the easy XDebug-Firefox-Plugin to start XDebug for you Symfony App (easy XDebug)
Thats it. This is working perfectly for my Symfony apps
As far as I undersand you, this is a std-situation when there is no 101-path-mapping from file-path to URL-path.
In Eclipse you can either define a completely new path-mapping or make Eclipse request a certain URL-path. In your case you would just define localhost as your server and '/s/web/frontend_dev.php/travel' as the path to attach.
I'm pretty sure there is a similar option in NetBeans as this is in times of mod-rewrite and Zend FW a very common situation.