Selenium IDE Basic Authentication - selenium-ide

Im am using Firefox Plugin Selenium IDE for testing (not Webdriver or else). Some areas of my webapplication are only accessible after basic authentication:
At the moment, I have to stop the test and type the login-data manually. When I pass my login-data via url: http://username:password#mydomain.com/, there appears a windows, where I cannot press the OK-Button via Selenium IDE:
Is there any way to login via Selenium IDE automatically?

I found one soulution by myself: Firefox plugin AutoAuth. Typing login and password at first time, using "Save Password" -function in Firefox, the Plugin AutoAuth sends Login-Data automatically, if authentication window appears next time.
Note: AutoAuth-plugin can´t be used, if the login-account has to be changed in context of Selenium-test.

To switch users when the site is using basic auth, you can specify the username and password in the URL you pass to the open command in the IDE.
Viewing the source code in the IDE it could look like this if you want to be first "user1" then "user2".
<tr>
<td>open</td>
<td>http://user1:pwd1#site.my/</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>http://user2:pwd3#site.my/</td>
<td></td>
</tr>

Related

Eclipse Browser has problems with rest api call

I have a problem with my eclipse browser.
If i call the url of my sonarqube server (https://sonar) everthing works fine and eclipse shows me the page. But if i try to call the api (https://sonar/api/system/status) it returns with an error window which says that the page could not be opened. The same url worked for me in normal browsers.
Question
Does eclipse browser has problems with calling rest apis in general? Or is there something i could do to make it work?
System:
Windows 10 Pro (10.0.15063 Build 15063)
Eclipse Oxygen.1a Release (4.7.1a)
Ok, the problem seems to be in IE (which is used by eclipse in default). If i call the url in IE it wants to download the json answer. I changed some values in registry so IE just show me the json in browser directly. After that also eclipse could show me hte result without error.
Here is my ie_json.reg file i executed to change values in registry:
Windows Registry Editor Version 5.00;
; Tell IE 7,8,9,10 to open JSON documents in the browser on Windows XP and later.
; 25336920-03F9-11cf-8FD0-00AA00686F13 is the CLSID for the "Browse in place" .
;
[HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/json]
"CLSID"="{25336920-03F9-11cf-8FD0-00AA00686F13}"
"Encoding"=hex:08,00,00,00
I found this solution at http://developers.de/blogs/holger_vetter/archive/2013/12/13/view-json-in-internet-explorer-7-11.aspx

How to disable a command in Selenium IDE

I have recorded some steps from http://docs.seleniumhq.org/ using Selenium IDE. After recording I have save the file as SeleniumhqExample.html -> I ran it and it passed successfully. I want to disable/inactive one of the recorded commands in Selenium IDE.
I want to disable the following command:
<tr>
<td>assertTitle</td>
<td>SeIDE Release Notes · SeleniumHQ/selenium Wiki · GitHub</td>
<td></td>
</tr>
How can I disable that single command in Selenium IDE? Please see the image:
You can do this by using HTML comments as . For example I want to disable the step assertTitle, follow the steps:
Go to "Source" Tab in Selenium IDE
Comments the specific step(s) as below:
Now the above step/command is disable and during running that step/command would be skipped and further steps/commands would be executed usually.
In the Table view disable/commented row should be shown as below:

Eclipse (Keplar) and Tomcat

I have an Eclipse workspace with a Web App (lets call it MyApp), and Tomcat server. When I run MyApp, Tomcat finds default.jsp and the opening page displays
http://localhost:8080/MyApp/Default.jsp?ActionPage=dashboard
- all fine and dandy.
This web page shows a menu. I choose a menu option from this page which should render
http://localhost:8080/MyApp/config.jsp,
and I get a HTTP Status 404 - /config.jsp ... ie it is looking for the page at
http://localhost:8080/config.jsp
and can't find it. Why is it looking there? It seems to have lost its context.
Netbeans doesn't exhibit this behaviour - it works fine. I just don't know where to look for a solution. Is it the Tomcat configuration or the Web App configuration?
All suggestions welcome!
When you choose your menu option, how is the URL called : simple form submit, ajax request?
In any case, you should have a URL looking like /MyApp/... in your code.
You can also check which URLs are effectively called by using a debug tool in your browser (ie Firebug for Firefox)
Another test to do if you use a Tomcat embedded in Eclipse is to start your Tomcat outside from your IDE, just to check the potential behaviour differences.

TeamCity Windows Tray Notifier stuck on "logged in"

When I run the Windows Tray Notifier on my Windows 8 virtual machine, it remains stuck on a "logged in" message if I hover over the icon of the program in the system tray, and I can't do anything else other than force the shutdown with the Task Manager. I set the correct address where my TeamCity test server is running but it seems unable to connect to. Any help is appreciated.
Fixed it via the following steps:
Repaired via installer (this clears saved login data)
Logged into a different server running Teamcity 6.5.3 - this worked
logged out again and logged into our main teamcity server (running 7.1) - tray notifier is working again
Very strange! Above workaround would only work if you had access to a second server too.
EDIT: Two further workarounds have been posted on the thread I started on the Jetbrains forum, so I'll repost them here for the benefit of others.
Solution 1:
Kill running tray notifier in task manager
Open regedit, in HKEY_CURRENT_USER\Software\JetBrains\TeamCity\WindowsTray\Login, update the “S” property to http://192.168.1.1:8080 (substitute real ip address, without the quotes, trailing / seems to be important)
Open IE, go to team city site
Log in, checking “remember me”
While IE is open and connected to TeamCity, start up tray notifier.
Takes about 15 sec to change from “logging in” to connected.
Solution 2:
Open IE, select Internet Options, Security Tab, add the TeamCity server address to the trusted list.
Please note, I haven't personally tested either of these methods, just posting them here for information since others have found them to work. Hope this helps!
Since upgrading the server to 7.1.1 this issue hasn't reoccurred for me. Looks like it's been fixed as per Eugene's comment elsewhere on this thread.
This issue is definitely a bug in the tray notifier.
It isn't popping up login credentials, so
Log first into IE
Check remember me - try to save credentials
Close IE/Launch the notifier
It should be successful
Henry Wilson posted the answer in their forums. Hopefully it's fixed soon.
I had a similar problem, the only difference is that it was stuck in "Loading..." and not in "Logging in...".
I added a trailing slash to the URL in "HKEY_CURRENT_USER\Software\JetBrains\TeamCity\WindowsTray\Login" but it didn't help, so I deleted the whole tree "HKEY_CURRENT_USER\Software\JetBrains\TeamCity". After a restart of the application, it asked again for the URL.
I use 8.0.5 on the server. The tray notification reports "build NA" in the about window...
I have had this on:
Windows 7 - 64 bit,
TeamCity Pro 7.1 (build 23907)
All other effects are identical as above.
The suggestions above didn't work for me, but it did allow me to re-enter the server address.. still the problem persisted.
What worked for me was to remove then re-install in "Program Files" instead of the default "Program Files (x86)". There are a few reasons why this as-a-fix should be unnecessary, but it worked and I'm happy.
This worked for me:
Open the CI-Server URL in Internet Explorer
Log out from the CI-Server
Restart the Tray Notifier (maybe kill via Taskamanger)
Log in again
p.s. not sure if it is relevant, but for completeness:
I also added the CI-Server URL in the trusted sites in Internet Explorer → Internet Options (as mentioned in this answer: https://stackoverflow.com/a/12001721/1520422)

GlassFish v3 in Eclipse shows "Wrong username or password" after starting

During the GlassFish installation I have chosen user name and password. These parameters are properly set on the Eclipse Server Adapter setting page. But when I start GlassFish in debug mode from Eclipse, I get "Wrong username and password".
There is nothing in the server log - in fact the server is started and works properly. The message only appears something like 95% of the time, and it is making debugging of the application problematic with the constant restarts and redeploys.
Anybody found how to overcome this problem?
I am using Oracle GlassFish Server 3.0.1 and Eclipse Helios Eclipse Java EE IDE for Web Developers (Helios Service Release 1 Build id: 20100917-0705).
For me the fix was to leave the "Password" field empty. I am however using different versions (but I stumbled upon this thread and maybe someone else will see this as well) of Eclipse and GlassFish(Eclipse Kepler & GlassFish 4.0).
I hope this helps anybody.
EDIT putting together compatibility of this fix from the comments:
Kepler & 4.0
Luna & 4.1
Mars & 4.1
I had this problem too. For me the solution was to disable the "Use Anonymous Connection for Admin Commands" option. To do so, follow these steps:
Right click on the Glassfish entry in the Server tab and click "Open" from the context menu. (Or press F3 while the Glassfish entry is selected.)
Make sure the box "Use Anonymous Connection for Admin Commands" is unselected, see the screenshot.
Don't forget to save before you retry...
If the log refers to full host names, like:
JMXService URL = service:jmx:rmi://my-work-pc.lan:8686/jndi/rmi://my-work-pc.lan:8686/jmxrmi
rather than, for example:
JMXService URL = service:jmx:rmi://localhost:8686/jndi/rmi://localhost:8686/jmxrmi
...then disabling the proxy settings in Eclipse (Preferences, General, Network Connections, Active Provider: Direct) might solve it.
For what I've read the default "Native" proxy setting yields problems as GlassFish by default binds to 0.0.0.0, which causes host name resolution rather than simply "localhost" in the RMI calls above. Given the host name it then finds, Eclipse might then feel it needs to use your proxy (if set) even for what is actually localhost.
My solution was just disable Anonymous Connection for Admin Commands. Auto deploy is another silly enabled default option because on every save freezes eclipse for a while, of course this does not count on small projects so you are good if you are writing only Hello world projects :)
I had the same issue while setting up glassfish4 with eclipse. Below setting resolved the issue:
Keep username as "admin" with a blank password (Unless you changed
anything while installation).
Select - 'Use Anonymous Connection for Admin Commands' checkbox.
Hope this helps.
it seems that the problem is removed when auto-deploy after changes option is removed.
For the first time from your eclipse do not set any username and password as #mgttlinger said. i hope now you can start the server without any issue.
Open admin console by localhost:4848(not it wont ask any credential)
To set admin password, go to Domain -> Administrator Password
Enter New Password and Confirm New Password.
Click on Save button
Restart the server
Try access localhost:4848(now you have to enter username and password to login admin console)
In Eclipse also set username as admin and given password to access glassfish server from your eclipse
If your OS is Windows, and your Glassfish installation location is in root directory (e.g. C:\dev\tool\Glassfish ), then try run Eclipse "as administrator", believe it or not, I know its a bit weird, that does solve the problem.
Had the same problem , did restore default to remove the password set at the time of server installation in eclipse. The server started after that.