Webdriver Server log - java

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.

Related

Selenium Basic Authentication via URL HeadlessChrome ( On Linux Server)

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.

Delete start message from selenium webdriver ie

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.

GWT Development mode - Unable to load module in Chrome

I'm trying to load my app in development mode using Chrome v. 20.0 on my local ip 127.0.0.1.
The app fails to load, and the following is displayed:
message:
"GWT Code Server Disconnected
Most likely, you closed GWT Development Mode. Or, you might have lost network connectivity. To fix this, try restarting GWT Development Mode and REFRESH this page."
on top of the previous message (overlaid):
"Plugin failed to connect to Development Mode server at 127.0.0.1:9997
Follow the underlying troubleshooting instructions"
This started to happen about 6-9 months ago and after 1 or 2 page refresh, the module loaded correctly. Now, i cannot load my app in dev-mode at all using Chrome. (in firefox
everything is ok).
I'm using GWT 2.4
UPDATE:
Those errors are not accompanied by any code stack trace output. Usually, if I changed the address form 127.0.0.1 to localhost, the module loaded, but this doesn't work any more...
Had the same problem. Deleting / reinstalling the plugin did the trick for me.
Check Automatically select an unused port of GWT from Run configuration.
My similar problem solved by this
I solved this in chrome by:
go to chrome://extensions/
locate GWT Developer Plugin
uncheck the Enabled box
check the Enabled box
Have a look at http://code.google.com/p/google-web-toolkit/wiki/TroubleshootingOOPHM
This page is supposed to be displayed in an iframe below the message (hence the message "underlying instructions", but Google has changed some server code on code.google.com and they now prohibit display within iframes, which is why it actually doesn't display.
FYI, the issue has been reported on GWT's issue tracker http://code.google.com/p/google-web-toolkit/issues/detail?id=7301
Your problem might be caused by improper gwt plugin setup. Go to your gwt developer plugin options (red toolbox right upper conner) in chrome and add your web and code server addresses. That worked for me.
Allowing "localhost" as webserver and code server made it work for me (although 127.0.0.1 was specified for both in the browser)

Where do I find the logs of System.out.println()?

I'm using Netbeans and I've checked the Server.log and all 3 output tabs in Netbeans for Glassfish, Java DB Database and my app's output. Where should I be seeing the output of System.out.println() ? I'm trying to connect to a MySQL server and I need to see if it worked or not :)
Turns out that I need to run the app in debug mode to see the output of System.out.println() in the glassfish console
check in build\testuserdir\var\log\messages.log
for more info checkout the following link
http://wiki.netbeans.org/NetBeansDeveloperFAQ#Output_Window

I am not able to connect tomcat with eclipse

My eclipse used to work fine but now I am no longer the administrator of my computer(I no longer have administrator priveledges) and i see that my already installed and working eclipse is now showing errors in my jsp files of the application which it didn't used to show before..
also I am not able to connect to tomcat server which seperately can be started normally but not inside eclipse.....
Is this something to do with my not being administrator anymore of is it something else....
would highly appreciate the help.....
I have now been able to run my tomcat server without admin previledge but problem of many files showing error still persists.........
the below written jsp code is showing error in all the files....:
<%
pageContext.getRequest().setCharacterEncoding("UTF-8");
String label = pageContext.getRequest().getParameter("rswitb1");
if(label==null)label="";
else label = label.replaceAll("<", "<").replaceAll(">", ">");
%>
I am not able to get what the problem ....
if anyone could help...
The connection to the external tomcat should be using only TCP/IP port 8080, there is no reason why a non-admin user should not be able to do that.
It's possible that your tomcat password has changed (or hasn't been set up at all)
There is a troubleshooting section at the eclipse wiki (if you are using WTP, that is)
First,check out the tomcat server is on: "netstat -an" to
find that whether the port8080 is used(if you didn't assign another server port.).
check out whether the server is on(netstat -an).
Maybe 8080 is used by tomcat.
You'd better reinstall tomcat as non administrator.

Categories

Resources