Getting past Watir & Basic Authentication [closed] - apache

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 6 years ago.
Improve this question
BLUF: Has anyone had luck bypassing/authenticating Apache Basic Authentication? Passing the username and password in the url string does not work.
I've looked through several questions here on SO and on blogs like WatirMelon.blog. The problem I have is simple: watir does not use the username/password passed along the urlstring to authenticate with the website.
Code
browser b = Watir::Browser.new(:chrome)
b.goto('https://user:passwd#my.site.com/index.htm')
I've even tried something akin to the following:
browser b = Watir::Browser.new(:chrome)
b.goto('https://my.site.com/index.htm')
sleep 5
b.send_keys("user{TAB}passwd{ENTER}")
and still have not had luck. It appears that once the basic auth window pops up, all actions halt until user input.
Does anyone have recommendations I haven't tried?
Admin notes:
* OS: Ubuntu 16.04
* Browser: Chrome (obviously)
* Watir 6

Watir will pass the url string to the url bar in the browser, but that doesn't mean the website will accept it (some do, some do not).
Basic authentication is a function handled by the operating system which is outside of the scope of Selenium & Watir. The best way to deal with it is to use a proxy like BrowserMob Proxy.

Related

Is there a way to view/interact with a website without entering in it? [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 days ago.
Improve this question
So my school has blocked all websites (for now at least) and I'm wondering if there was a way to access them without entering into them. What I've thought is that this could be done with google as google search can show you certain parts of pages.
Also, the current configuration of the firewall allows you to do google search and access certain websites. I also know that they perform this using a man in the middle attack intercepting SSL connections. Is there any VPN, tool or script that can bypass this? Something to do with packets obfuscation using XOR gates? I've tried using many different VPNs but all seem to not work.
Thanks in advance.

How to use reCaptcha2 solving Services in Selenium python : Python Auto Captcha solver [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I am trying to automate a website and it's displaying captcha at some point I just want to know how I can add Auto Recaptcha solving services in my code so the execution of the code does not stop. I have tried Anti-captcha but it's not working and they don't have proper instruction on how I can use their service.
https://anticaptcha.atlassian.net/wiki/spaces/API/pages/196635/Documentation+in+English
This is an anti-captcha documentation page but I am not getting what I have to do to use it in python.
Is there any way I can bypass reCaptcha using any paid service?
I've used 2captcha before for automating captcha solving. So that would be my first go to. They have easy to read documentation and getting it setup with selenium isnt to challenging. https://2captcha.com/api_examples

How to identity element in selenium for below html [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 6 years ago.
Improve this question
<a href="XXXX.asp?WCI=XXXX_Process&CacheID=123351730222025121&menuopt=Policy&TransTyp=NBS">
<strong><font face="Arial" color="Navy">New Business - Rate</font></strong>
</a>
How to identity element in above html,I tried below code but it didnt work out
driver.findelement(By.cssselector(a[href='given the full href link'])).click ()--didn't work out due to cacheID is dyanamic
driver.findelement(By.cssselector(a[href*='TransTyp=NBS'])).click () --tried with partial word didnt work either
Kindly help me on this.
i tried same thing in chrome it works like a charm,even my earlier code works fine with chrome.Not sure if internet explorer has any issue handing them . I am using windows 10 OS and internet explorer comes with it.
In Internet explorer i can able to login with selenium after the landing page when i want to click new business link its not working,but the same code works fine in chrome.
Is there any reason for this ?
You should use XPath. And you need two steps here:
Find element by text
Find closest a to element with link text
Here is XPath which does that:
driver.findelement(By.xpath("//*[text()='New Business - Rate']/ancestor-or-self::a"))
driver.findElement(By.linkText("New Business - Rate"));
Worked on this issue after longtime.Its my fault, not aware of Frames concept.
The webpage i was working involves Frames in Internet explorer.
Working fine with linktext itself.Thank you

Google Cache is showing different Url then my Web Site Url [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 16 days ago.
Improve this question
I have faced a problem which I can't understand whether it is from my end or the web site has been hacked or attacked. Let me explain my scenario.
Suppose I have a website www.abc.com when I open it on browser it is working fine.
when I use cache:www.abc.com the google caches shows that image of www.xyz.com is taken on (dd-mm-yyyy) date.
When I go to www.xyz.com it is exactly the copy of my script with the change of design (HTML).
How is this possible?
Is my website hacked? Can anyone tell me what exactly is wrong with it.
Help will be greatly appreciated.
Report the problem to google webmaster support. And also make sure you have added your website in google webmaster and have it verified. Also try resubmitting your website for getting indexed and cached by google. Here is the link . If you provide the url of your website may be i can help better.

How to program Selenium to bypass Login page? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I have written 3 Selenium WebDriver 2 tests using Python. All of them log in first and then check functionality further down the application. How could I bypass the login page and go directly to a page?
Thanks.
It depends on the application. If it does not allow an unauthorized access to a page, then you have to login.
However, you could possibly pass the authorization once and then access various pages within one session. Just remove steps implying logging out or closing the browser.
If you are using TestNG or JUnit, you can place the authorization to #BeforeClass or other #Before* method. Which one are you using?
UPD:
In case you are using Python+unittest, put authorization actions to the setUpClass() or startTestRun() method, whichever suits better.
You want to find a way for a client (selenium test) to bypass the login required by the server?
If it is possible, your security is a big failure.
Selenium has a simple purpose: make a real functionnal test.
If the use must login to do something, test it correctly. So login.