-
Notifications
You must be signed in to change notification settings - Fork 999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No possibility for sending text on alert prompt #548
Comments
@createNull I tried playing around with regular WebDriver calls to send text, but it didn't seem to work. It might be an issue on WebDriver's end and you might have to open an issue on the Selenium Project's GitHub page. As for the test, I've expanded on it, although still can't send text to the input. from seleniumbase import BaseCase
class MyTestClass(BaseCase):
def test_alerts(self):
self.open("about:blank")
self.execute_script('window.alert("ALERT!!!")')
self.sleep(1.2) # Not needed (Lets you see the alert pop up)
self.wait_for_and_accept_alert()
self.sleep(0.8) # Not needed (Lets you see the alert go away)
self.execute_script('window.prompt("My Prompt","defaultText");')
self.sleep(1.2) # Not needed (Lets you see the alert pop up)
alert = self.wait_for_and_switch_to_alert(timeout=2)
self.assert_equal(alert.text, "My Prompt") # Not the input field
self.wait_for_and_dismiss_alert()
self.sleep(0.8) # Not needed (Lets you see the alert go away) If you can figure out a way to send text to an alert using regular WebDriver calls, I'm happy to add that into SeleniumBase as a standalone call. As for the pytest requirements issue, there is a major regression in the latest version of pytest, so I pinned the dependency within SeleniumBase to a slightly older version that works perfectly. There's already a ticket on that here: #534 |
The issue here |
I managed to use Basic auth with python requests, but can't link it to selenium webdriver session. |
@createNull Looks like you found the original WebDriver issue. As for workaround, I found a StackOverflow post that may help you: https://stackoverflow.com/q/27322871 If you're connecting to a proxy server with authentication through Chromium, there's already a SeleniumBase solution built-in. Add the following to your run command: --proxy=USER:PASS@HOST:PORT |
Found this solution as well, but when it failed to log me in while copy pasting the URL inside the browser window (for Chrome), I gave up on it. self.open(USER:PASS@DOMAIN) it works absolutely fine without using any Thank you for the assistance @mdmintz . Now I need to figure out where to store the credentials |
@createNull Great! If you're all set, we can close this issue. |
Hi,
I am trying to send some text to an alert prompt, but can't figure out how using seleniumbase.
This version actually fails. Remove line 14 and it will pass, but it doesn't send any text regardless.
Session data
metadata: {'Python': '3.8.2', 'Platform': 'macOS-10.15.4-x86_64-i386-64bit', 'Packages': {'pytest': '5.3.5', 'py': '1.8.1', 'pluggy': '0.13.1'}, 'Plugins': {'html': '2.0.1', 'rerunfailures': '9.0', 'xdist': '1.31.0', 'ordering': '0.6', 'seleniumbase': '1.37.8', 'forked': '1.1.3', 'metadata': '1.8.0', 'cov': '2.8.1'}}
P.S. Just installed latest version of pytest and got this:
ERROR: seleniumbase 1.37.8 has requirement pytest==5.3.5; python_version >= "3.5", but you'll have pytest 5.4.1 which is incompatible.
The text was updated successfully, but these errors were encountered: