Requirement:I want to automate application using selenium which is built using cef and some windows control.to launch the application we need to create shortcut and edit target with the url alone with file location or.Other way to launch the cef application is to pass the url along with the file address on cmd.
Exact issue I am facing is that I am able to tell webdriver to open the cef application using options.setbinary but for some reason webdriver is not accepting the url when I am passing the url using options.addargumnets().
Options.setBinary("my application.exe address");
Options.addArgument("url");
//Initialized driver with options
I forgot to update I have resolved this issue, I had to check the development code. when I asked dev to attach remote debugging port while initialising new browser from exe and then I used chromeoptions setexperimentaloptions() property to control already running chrome browser.
Related
I want to open an application website on Firefox browser using Selenium Webdriver as a different user.
Currently, I am using gecko driver to open that application link, it successfully opens up the browser but unable to open the application link.
But I am able to achieve the same manually by going to Mozilla Firefox icon and clicking on
"Run as different user"
option (as shown in below image) which further open a popup for user credentials and by entering Username and Password of different user there I am able to open the application link in browser.
So, is there any way that I can achieve same process using Selenium Webdriver and opens up my application link.
Thanks in Advance!!
You should rather create Firefox profile by running firefox.exe -p to launch profile manager. Then you can instantiate firefox web driver implementation and configure it to use given profile.
Are you sure that you want to use pre-configured profile? I find much easier to manage to run drivers in private/incognito mode and set cookies manually to configure tests.
You might provide firefox_binary as a parameter for the webdriver:
http://selenium-python.readthedocs.io/api.html
firefox_binary – Instance of FirefoxBinary or full path to the Firefox
binary. If undefined, the system default Firefox installation will be used.
...so, you might use a wrapper script to run firefox as the different user (use sudo in Linux).
I am working on selenium web driver. I want to open existing browser window via selenium script(Java).
There is no built-in method in Selenium that supports this feature directly. However, you can try the following:
driver.get("link");
driver.find_element_by_link_text('new link name').click().switch_to.window(driver.window_handles[0]);
Just switch to handle for self.You can also try storing handles in variables if you like.
The whole post can be found here.
There are many selenium webdriver binding package of Golang.
However, I don't want to control browser throught server.
How can I control browser with Golang and selenium without selenium server?
You can try github.com/fedesog/webdriver which says in its documentation:
This is a pure go library and doesn't require a running Selenium driver.
I would characterize the Selenium webdriver as a client rather than a server. Caveat: I have used the Selenium webdriver (Chrome version) from .Net and I am assuming it is similar for Go.
The way Selenium works is that you will launch an instance of it from within code, and it creates a live version of the selected browser (i.e. Chrome) and your program retains control over it. Then you write code to tell the browser to navigate to a page, inspect the response, and interact with the browser by filling out form data, clicking on buttons, etc. You can see what is happening on the browser as the code runs, so it is easy to troubleshoot when the interaction doesn't go as planned.
I have used Selenium to upload tens of thousands of records to a website that has no API and only a graphical user interface. Give it a chance.
How to record scripts in Selenium RC? As of now, it throws security alerts at me (Trusted certificates), I'm so unable to record it. Please help me, how can we overcome this problem?
You have two options
Start the rc with -trustAllSSLCertificates parameters.Your startup command should look like
java -jar selenium-server-standalone.jar -trustAllSSLCertificates
You should create a firefox profile as mentioned here. Be sure to note down the path where the profile is being created. Then open firefox in that profile (refer the same mozilla support page if you don't how to open FF in a profile) and browse your application. You will have then be prompted to accept certificate. Accept the certificate and close the browser. Now manually open firefox using the newly created profile and access the application one more time. It should not show the certificate error now. All you need to do now is to ask selenium to use this new firefoxprofile. This can be done by using the -firefoxProfileTemplate parameter during selenium server startup
java -jar seleniumserver.jar -firefoxProfileTemplate="Path to firefoxprofile folder"
i have created firefox template and started selenium server from command line giving -firefoxProfileTemplate "path to the profile" but still it asks for proxy?
any solutions?
Have you changed the lan settings for your new FF profile to use the proxy?
When the tests open the FF browser, check the proxy settings manually and see if its there? If not, then Selenium might still be NOT using the correct profile.