I m using Selenium IE Webdriver.I want to delete "This is the initial page of webdriver server." from IEDriverServer.exe file of Selenium IE Webdriver. I opened the IEDriverServer.exe file in notepad++ and deleted that line from it and again add it in my classpath.But then i get this error:
org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
How can we do that.Please someone tell me.
You can't just edit an executable file like that. You have undoubtedly ruined the executable and now should redownload it from the Selenium site.
Regardless, this is expected behaviour. The IEDriver must have somewhere to go to begin with.
There is a setting that configures this URL called InitialBrowserURL. If this is not configured in your code, then the default is used.
Configure this to what you want. Most cases it can be configured to just go to the home page of your application.
Related
In my Selenium Tests I need to test a webpage where I use a basic Authen,
Knowing that I am using Chrome Headless Java and Selenium WebDriver.
On my machine 'locally' It works perfectly using driver.get("https://admin:admin#localhost..");
and then
driver.get("https://localhost..") for example.
I know that Chrome doesn't support this function anymore but I managed to make it work based on someone's solution here by passing the first URL with credentials and the second without.
But when I run it on remote (Jenkins) On Linux servers I get the following Error
the configuration of your browser does not accept cookies
. I don't have vision on the servers when I can configure Chrome ..any ideas how to make it work without facing that problem.
I know a lot of people asked that question before, But I didn't find any valide answer for my issue.
try ChromeDriver 2.45 (changelog) or change the location, where it is supposed to save the cookies:
ChromeOptions options = new ChromeOptions();
options.addArguments("user-data-dir=/path/to/your/custom/profile");
otherwise (per default) it would create a new temporary directory each time it starts a session.
ChromeOptions options = new ChromeOptions();
//Command line flag for enabling account consistency. The default mode is disabled.
options.addArguments("--account-consistency");
//Chrome that will start logging to a file from startup
options.addArguments("--log-net-log=C:/some_path/resource/log.json");
//Sets the granularity of events to capture in the network log.
options.addArguments("--net-log-capture-mode=IncludeCookiesAndCredentials");
Try this, basically, it saves the logs on startup of chrome browser, then it will set the account consistency. Anywhere from the log, you can debug the issue.
Hello I managed to fix the problem (I forgot to mention that our website is protected by Siteminder) so I did the following following:
1-We inject the USER and the PASSWORD on the URL :
The issue we faced was that the displayed prompt wasn’t part of the page’s HTML and it was hard for us to catch it using Selenium. We managed this by directly injecting the user login and the user password in the URL as follow :
‘https://USERNAME:PASSWORD#basicAuthentURL’
This will launch the Chrome session. Beware, this is only the first step of the process. The user identification have not been performed yet.
2- We create a new cookie :
After launching the URL, we have to manually create a cookie called « SMCHALLENGE » and add it to current session with Selenium, for example in JAVA :
new Cookie("SMCHALLENGE", "YES");
3- Call the URL without the user credencials :
As the SMCHALLENGE cookie is now set, the last step is to call the URL again (https://basicAuthentURL ). The SMCHALLENGE cookie will be deleted once the authentication succeed and a SMSESSION cookie will be generated by Siteminder.
The SMSESSION cookie now allows us to call the application and sucessfully pass Siteminder as if normally logged in (via SSO).
Let me know if you try this out.
I'm running an automation on mac and on ubunto (using cucumber, selenium web driver, junit)
during the automation I click a link with non http protocol
an "External protocol request" popup appears.
It blocks my test from testing the rest of the webpage.
How can disable this popup for all chrome profiles? even incognito\anonymous chrome?
I have tried to add "" to the /Users/eladb/Library/Application Support/Google/Chrome/Local State file.
protocol_handler":{"excluded_schemes":{.."waze":false,"mailto":false,..}
and also tried:
protocol_handler":{"excluded_schemes":{.."waze":ture,"mailto":false,..}
but even after a restart and running the test, the popup appears.
Create you driver instance with chrome options as follows:
ChromeOptions cChromeOptions = new ChromeOptions();
cChromeOptions.addArguments("--test-type");
WebDriver _driver=new ChromeDriver("path_to_your_Chrom_Driver", cChromeOptions);
I tried the 'Local State' file also not working. Someone pointed out the folder Default/Preferences file. Make your change there and it will work.
I am using Selenium 2 WebDriver API and receiving Unable to locate element Error when I am running my Tests. The element is an iframe. But wait , when I run the test locally (in my local server) it works fine (via driver.switchTo().frame("frame id");) approach, but when my tests run on live server, the error arrives.
The one difference between them is that the live server is running on https.
Is that the issue that WebDriver is not recognizing iframe over SSL ??
Any Help is appreciated.
Use driver.switchTo().frame(index);
Would any one please explain how to check webdriver server log? The log we used to see by running selenium server from command line. I am using firefox driver with latest stand alone server. I tried this link to create firefox profile with preferences but I didnt get any result out of it.
Please share your idea or any work around. Thanks
you can use selenium-standalone-server-2.15.0
In this version they make the loggers as default. So that you can find logs on your editor(Eclipse) console itself.
I exported a working Selenium test case to Java, running it via selenium-rc's selenium-server.jar in Junit4 on Eclipse.
The test case breaks the next step after opening the page, trying to write to an element. When stepping through the runtime I noticed the error,
The requested URL could not be retrieved
The following error was encountered:
Unable to determine IP address from host name for unknown server name
This means that: The cache was not able to resolve the hostname presented in the URL. Check if the address is correct.
So, I changed the url to the corresponding IP address of the web page, but now I am timing out.
Opening the page using both the url and IP formats manually is working, (except IP doesn't for IE8). I'm originally targeting Firefox, but will expand to other browsers once I have solved this issue.
Is there a security issue involved with Selenium opening a page in a browser via RC programatically that browsers don't like? What sort of issues should I be investigating to solve this?
I think you are trying to open a secure page.In selenium pages which has ssl certificates should be handled.
The problem actually came down to the proxy set up on my machine. After removing it things worked fine.