How to automate window page login using selenium - selenium-webdriver

In my web based application login form is window popup ,so that its not possible to automate using selenium webdriver , i have tried using robot class but didn't get the result, can any one suggest a solution for it.

if its authentication then you can try sending username password in URL. Also take a look at AutoIT for such cases.
EDIT: It depends on the type of authentication like HTTP / HTTPS so on and so-forth
One example can be this: https://serverfault.com/questions/371907/can-you-pass-user-pass-for-http-basic-authentication-in-url-parameters/371918

Related

Start a browser with a logged proxy in Robot framework

i'm facing the current problem: Since i'm under VPN, when i open a browser, a browser popup appears and ask me for the user and password credentials:
I need to open a browser in robot framework (firefox or chrome is the same) with a logged proxy.
I know that is possible to open a firefox instance with a proxy by using SeleniumLibrary Create Webdriver:
${proxy}= Evaluate selenium.webdriver.Proxy() modules=selenium, selenium.webdriver
${proxy.http_proxy}= Set Variable localhost:8888
Create Webdriver Firefox proxy=${proxy}
The problem is that it seems not possible to pass the credentials (user and password) for the proxy login.
Also, like most of the people suggest, i know that is possible to open the browser logged in with the proxy by using the url formatted like (in past i've also used that on different projects):
https://proxy_user:proxy_password#url_to_reach.com
but for some reason it doesn't work, i still have the browser popup asking me the credentials.
I've also tried by using Input Text Into Alert but it doesn't fill the alert fields:
Input Text Into Alert text=username action=LEAVE
I've also thought that maybe it is possible to do by using some preferencies with chrome or a profile with firefox but i've found nothing about this. Any other method by javascript?
Anyone can help? Thanks a lot

How to pass\ in URL in windows authentication?

To handle windows authentication, one way to handle such scenario is by passing credentials in URL itself as shown below :
driver.get('http://domain\username:password#abc.com')
my user name contains a domain ex. domain\Username. However, when i pass https://domain\username:password#example.com URL it gets converted to '/'. I am using C# selenium bindings. Please suggest a solution to get this working.
You need to replace any special character using its ASCII value .
For \ , it's 092
Also, I believe browsers have dropped support for this syntax of passing credentials along with url and i am sure it won't work if you are using latest browser version of chrome/firefox.
You should instead allow browser to show credential alert and handle it using selenium.
IAlert alert = webDriver.SwitchTo().Alert();
alert.SetAuthenticationCredentials(userId,password);
alert.Accept(); //not sure if this line is required.

How can I scrape data from a website protected with Shibboleth?

I am attempting to scrape data from one of my University's websites, which uses Shibboleth as a form of authentication/protection. However, I am having difficulty determining the best way to get past it and to the page I wish to scrape. I have valid credentials, which I could use to log in with. Does anyone have any suggestions for how to accomplish this task?
I have been working on scripting Shibbolized login with success ( in my case, to monitor the health of both the Shibboleth IdP and the applications it protects).
I am using Python's urllib module and their classes to handle the redirect following and cookie passing (for Shibboleth) and login form posting. After a little bit of tinkering urllib gets you most of the way to success with Shibbolized login. You could use this approach to handle the initial login to the Shibbolized website and then handle the scraping with a straight forward use of Python's urllib.
Example Python script for logging into Shibboleth
You could use Mechanize to submit forms and login to the website: http://wwwsearch.sourceforge.net/mechanize/
I believe that ECP profile was design to access Shibboleth protected resources by non-browser client (i.e. command line)
Try one of sample clients available on Shibboleth wiki page I linked above
You can also try Apache JMeter, just record your actions, make some scripting (well it is not so easy in terms of shibboleth), and you can access this pages automatically.
[Edit - better solution]
I believe that on Shibboleth Documentation pages are scripts for Grinder (another load testing tool). This test plans where in fact Python (ok Jython) scripts which should be quite easily modified and used for your purposes
Very late reply, but you could use Facebook Webdriver to do a login and scrape after you're authenticated.

Handling Google clientLogin Captcha Example

I have a desktop application.
I try to perform authentication using
http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html
However, whenever I get a Captcha challenge, I use a HTTP GET request (I test using web browser) to get the image to present to user.
https://www.google.com/accounts/Captcha?ctoken=Y-DrsDJRiWNOP3gR7fq0PAq4Yxvi3UXewu7P7jgAKjk0eZKQ358nbh27-JZ3-nlzXvfKOD3JvZNXwmlRunyz8jPKzqmkOLw2LYb3ZWjg-tE%3A0gMUFttsSH7QwganSJd1aw
However, I always get the images :
Sorry, we are unable to handle your
request at this time. Please try again
later.
Any idea what I had did wrong? Thanks!
I had solved the problem, please refer to code
http://jstock.cvs.sourceforge.net/viewvc/jstock/jstock/src/org/yccheok/jstock/gui/Utils.java?revision=1.86&view=markup (See getCapchaRespond method)
http://jstock.cvs.sourceforge.net/viewvc/jstock/Cloud/src/java/org/shuwnyuan/cloud/Authenticate.java?revision=1.2&view=markup

Silverlight - Check Website

How do I check to see if a website exists at a URL in Silverilght? I basically want to ping a web page. However, the WebClient does not seem to work for me. Is there a way to check HTTP response codes in Silverlight? What does the code look like to ping a web site?
Thank you
You could parse out the results from http://downforeveryoneorjustme.com/.
Check out URL Access Restrictions in Silverlight, and here's an example for Using WebClient and HttpRequest.

Resources