selenium - send basic authentication while the password contains "#" [duplicate] - selenium

This question already has an answer here:
Python HTTP Basic Authentication through Selenium when username and password contains special characters
(1 answer)
Closed 2 years ago.
Our test environment is using a basic authentication and I'm trying to send the parameters in the URL header.
The only problem is, our password already contains "#", which means everything after it is considered as the website URL itself.
I've been trying to use "%40" which represents this character but it didn't work.
Here's the header assuming the username="username" and the password is "my#password":
driver.get("https://username:my%40password#test.website.com");
It used to work on my older computer, but something doesn't work on this one.
Any suggestions?

It used to work on my older computer
How long ago did it actually work? This old Chrome browser feature was removed from Chrome for years, but I learned from a bug report I filed that it's been brought back, although it only works in Selenium, not for a regular Chrome user in the address bar.
Perhaps Chrome's current "resurrected" name:password# feature no longer supports the %40 trick you used to use?

Related

Are there significant risks of using chrome driver [duplicate]

This question already has an answer here:
Security Considerations - ChromeDriver - Webdriver for Chrome
(1 answer)
Closed 2 years ago.
I need to use chrome driver to automate web navigation using selenium.
However, the work computer that I use did not like it, I had to bypass a couple of security blocks. When I dowloaded chrome driver I tried to run it in the cmd terminal which threw up a link and a recommendation that I should read its contents. the link was the following:
https://chromedriver.chromium.org/security-considerations
The link's web page contained a series of warnings about running chrome driver on a computer that has privileged access to information. My computer happens to have just that.
I need to find a way of automating website navigation with or without chrome driver, what should I do??
This is probably because it can do stuff like access websites that you might not want to access, either because its private data or because its a site that you arent allowed to access by law. Pretty sure that, as long as you dont run scripts from others, and know what you are doing yourself you arent taking a risk. The main problem is, that you might not be able to cancel it anymore if it runs once. If you rather do it in another way, you can use the geckodriver from firefox, i have not had such a warning yet but i assume the risk is the same

Unsafe JavaScript attempt to access in capserjs [duplicate]

This question already has an answer here:
Using PhantomJS to embed all images of a webpage produces warnings but works
(1 answer)
Closed 7 years ago.
On each test run of casperjs test, the output closes with the following:
Unsafe JavaScript attempt to access frame with URL about:blank from
frame with URL file:///usr/lib/node_modules/casperjs/bin/bootstrap.js.
Domains, protocols and ports must match.
My tests pass. Everything else looks okay, but is this block of text important? Does it suggest that I set something up incorrectly.
Even running a command as below shows the same message.
$ casperjs --version
1.1.0-beta3
Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file:///usr/lib/node_modules/casperjs/bin/bootstrap.js. Domains, protocols and ports must match
Richard,
Apparently, the problem is related to the safety of this request when opening about: blank.
Many of the problems faced in abrri a specific URL and potential security problems, I managed to solve by adding the following code in ALL my scripting calls:
casperjs --web-security=no --ssl-protocol=any --ignore-ssl-errors=yes test C:\path_test\file_test.js
Why in all the executions? In most tests that do, my URLs are https and even on things on the type http, my play with the above code did not work problems and my goal in the project, I had no problem and solved these safety issues.
Take the test and see if it resolves your problem, it still does not work, maybe we can "debug" if not missing something related to CasperJS or PhantomJS, something related to machine configuration, permissions, user, etc.
From the comments to the original question, I downgraded phantomjs
sudo npm -g install phantomjs#1.9.7-15
This remedied that output. However, I still don't have enough knowledge to be able to explain why. If anyone does, I'm happy to mark that as the correct answer.

Cross browser UI testing [duplicate]

This question already has answers here:
What's the best way to test cross-browser compatibility?
(4 answers)
Closed 9 years ago.
when we develop any website then it looks good at our end but client may view the page with different browser then he/she face problem. i search for tool or way by which i can view my pages from my local machine using different browser and different version. i found few web site provide this facility and saw they very slow and they are giving image of my page which i do not want rather i want to view my page in browser. so i want a tool which allow me to select browser and version and then show my page in that browser with specific version. i may change version and page should refresh for changing browser or version. i hope there must be many tool available but unfortunately i not getting right single one. can anyone guide me. thanks
Adobe shut down BrowserLab a few weeks ago, but provided some guidance for other services that you can use on this page. There there are the Spoon.net browser sandboxes, but it installs the VM on your computer and I never liked that.
I personally use VMWare virtual machines with olders versions of IE on Windows, and Safari on a Mac VM. A little more effort to set this up, but I find it works best.

March 2013: Paypal Sandbox login loops back to developer page [duplicate]

This question already has answers here:
Please login to use the PayPal sandbox feature
(5 answers)
Closed 9 years ago.
Since Paypal developer changed in March 2013, I've been unable to get into the sandbox.
I logged in to the new developer site OK with my actual Paypal account details.
I managed to import my accounts into the new development site (marked worryingly as 'beta') using the link
"Looking for Sandbox? Import your test accounts to continue testing. Learn what's new."
But clicking the link 'Sandbox site' on any of the accounts results in me being taken to:
This is the link where I'm greeted with a Paypal Sandbox logo and a single link reading "Please log in to use the PayPal Sandbox features."
Clicking on this link takes you back to where you have come from - that is the developer page where I am already logged in.
I did raise a support question with Paypal, but a week has passed and it's gone unanswered, so I'm hoping someone here can tell me what I'm missing in this new version?
I'm unable to reproduce this. I'm logging into my sandbox accounts just fine. I'm also able to test things like Express Checkout without any issue.
I know that browser cache and cookies can often be a big issue on the sandbox. For example, when I first attempted to try this after seeing your post I was getting a Proxy Error when trying to load sandbox.paypal.com. I closed and re-opened my browser, though, and then everything worked as expected. Maybe give that a shot.
As Andrew Angell points out - this crazy behaviour was down to the web browser caching. I just cleared out everything in Chrome (Tools > Clear Browsing Data) and wiped everything since the beginning of time and that's got it. Nice catch, thanks Andrew. Appreciated.
The reason every browser I tried did this, is because I've used them all with Paypal - of course - so hence they all do the same thing, leading you to thing the issue is upstream.
Clear your cache and cookie simply by pressing
CTRL + SHIFT + DELETE for WINDOWS
COMMAND + SHIFT + DELETE for MAC
It works for me.
Clearing doesn't help me with this, USE CHROME INCOGNITO MODE(new window) - it works for me :)

How to specify server name when xmlhttprequesting from a remote server?

See this question first, and the top answer. That being said, I need to issue an XMLHttpRequest to a remote server from a mobile app. Can someone show an example? I can't figure out where to specify the URL (with parameters) as shown in the answer to the previous question.
XMLHttpRequests takes a URL as a parameter. It can be a relative URL, but it can also be a fully qualified URL...except that it probably won't do what you want, due to cross-site scripting protections built into most browsers.
This question has details on solutions to this issue.