Skip to content

Instantly share code, notes, and snippets.

View seleniumgists's full-sized avatar

seleniumgists

View GitHub Profile
@seleniumgists
seleniumgists / file.html
Created November 2, 2020 11:57
generated automatically from #selenium on seleniumhq slack
Message: Session [<SESSION ID>] was terminated due to BROWSER_TIMEOUT
@seleniumgists
seleniumgists / file.html
Created November 1, 2020 11:25
generated automatically from #selenium on seleniumhq slack
url = '<http://sahitest.com/demo/clicks.htm>'
driver.get(url)
action = ActionChains(driver)
buttonQuery = 'body > form:nth-child(1) > input:nth-child(10)'
button = driver.find_element(By.CSS_SELECTOR, buttonQuery)
action.click(button).perform()```
after running that, you will find **[CLICK]** shows
then try
@seleniumgists
seleniumgists / file.css
Created November 1, 2020 11:22
generated automatically from #selenium on seleniumhq slack
url = '<http://sahitest.com/demo/clicks.htm>'
driver.get(url)
buttonQuery = 'body > form:nth-child(1) > input:nth-child(10)'
button = driver.find_element(By.CSS_SELECTOR, buttonQuery)
action.click(button).perform()
@seleniumgists
seleniumgists / file.html
Created November 1, 2020 11:16
generated automatically from #selenium on seleniumhq slack
url = '<http://sahitest.com/demo/clicks.htm>'
driver.get(url)
action = ActionChains(driver)
# double click
buttonQuery = 'body > form:nth-child(1) > input:nth-child(8)'
button = driver.find_element(By.CSS_SELECTOR, buttonQuery)
action.click(button).perform()```
after this, try
```action.reset_actions()
action.perform()
@seleniumgists
seleniumgists / file.py
Created October 27, 2020 19:50
generated automatically from #selenium on seleniumhq slack
await new Builder().forBrowser('chrome').build();
@seleniumgists
seleniumgists / file.m
Created October 27, 2020 07:53
generated automatically from #selenium on seleniumhq slack
FROM selenium/here_the_image_you_need
USER root
# Install certificates
# Restore default user
USER seluser
@seleniumgists
seleniumgists / file.py
Created October 26, 2020 16:50
generated automatically from #selenium on seleniumhq slack
from selenium import webdriver
browser = webdriver.Firefox()
browser.get('<http://seleniumhq.org/>')```
and I get an error.
```selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities```
so then I try to load the capabilities using
```from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
@seleniumgists
seleniumgists / file.css
Created October 23, 2020 09:03
generated automatically from #selenium on seleniumhq slack
selenium-side-runner --output-directory=results -c "browserName=chrome platform=linux chromeOptions.binary="/opt/google/chrome/google-chrome" goog:chromeOptions.args=[no-sandbox, headless]" example.side
@seleniumgists
seleniumgists / file.cpp
Created October 16, 2020 18:10
generated automatically from #selenium on seleniumhq slack
Started InternetExplorerDriver server (32-bit)
3.150.1.0
Listening on port 32217
Only local connections are allowed
13:29:16.748 WARN[
LoggingOptions$1.lambda$export$1
]"-"{
"traceId":"928b37e7bf8d28dad0b418b34b74eeef",
"spanId":"6bf43cbe111a7a64",
"spanKind":"INTERNAL",
@seleniumgists
seleniumgists / file.css
Created October 9, 2020 19:48
generated automatically from #selenium on seleniumhq slack
options.AddUserProfilePreference("profile.block_third_party_cookies", false);```
```options.AddUserProfilePreference("security.cookie_behavior", 0);```
```
Here is my setup code```
``` new DriverManager().SetUpDriver(new ChromeConfig());
var options = new OpenQA.Selenium.Chrome.ChromeOptions { };
options.AddArgument("–no-sandbox");
options.AddArguments("-disable-gpu");
options.AddArguments("-disable-dev-shm-usage");
options.AddArgument("-incognito");