Skip to content

Instantly share code, notes, and snippets.

View seleniumgists's full-sized avatar

seleniumgists

View GitHub Profile
@seleniumgists
seleniumgists / file.html
Created August 20, 2020 13:09
generated automatically from #selenium on seleniumhq slack
WebElement element = .......
Select select = new Select(element);
@seleniumgists
seleniumgists / file.py
Created August 20, 2020 07:10
generated automatically from #selenium on seleniumhq slack
WebDriverException: Message: Session [] was terminated due to TIMEOUT
Stacktrace:
at org.openqa.grid.internal.ActiveTestSessions.getExistingSession (ActiveTestSessions.java:105)
at org.openqa.grid.internal.Registry.getExistingSession (Registry.java:404)
at org.openqa.grid.web.servlet.handler.RequestHandler.getSession (RequestHandler.java:232)
at org.openqa.grid.web.servlet.handler.RequestHandler.process (RequestHandler.java:118)
at org.openqa.grid.web.servlet.DriverServlet.process (DriverServlet.java:83)
at org.openqa.grid.web.servlet.DriverServlet.doPost (DriverServlet.java:67)
at javax.servlet.http.HttpServlet.service (HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service (HttpServlet.java:790)
@seleniumgists
seleniumgists / file.m
Created August 18, 2020 21:36
generated automatically from #selenium on seleniumhq slack
# Generated by Selenium IDE
from selenium import webdriver
from <http://selenium.webdriver.common.by|selenium.webdriver.common.by> import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import unittest
from time import sleep
class _TestUntitled(unittest.TestCase):
@seleniumgists
seleniumgists / file.c
Created August 18, 2020 18:56
generated automatically from #selenium on seleniumhq slack
self.driver.find_element(By.CSS_SELECTOR, "facebook").click()
wait.until(EC.number_of_windows_to_be(2))
for window_handle in driver.window_handles:
if window_handle != original_window:
driver.switch_to.window(window_handle)
break
sleep(10)
wait.until(EC.title_contains("facebook"))
assert "Facebook" in driver.title
self.driver.close()
@seleniumgists
seleniumgists / Untitled
Created August 14, 2020 06:06
generated automatically from #selenium on seleniumhq slack
// The id of the checkbox we intend to click.
final String checkboxIdToClick = "363171428_2399318203";
// Check values of the map for a webelement that has a matching id attribute.
getCheckboxMap().forEach((k,v) -> {
// If the value's attribute matches expected id, then the key webelement should be clicked since the child cannot.
if(v.getAttribute("id").equals(checkboxIdToClick) k.click()
});
private Map<WebElement,WebElement> getCheckboxMap() {
@seleniumgists
seleniumgists / file.m
Created August 14, 2020 06:03
generated automatically from #selenium on seleniumhq slack
// The id of the checkbox we intend to click.
final String checkboxIdToClick = "363171428_2399318203";
// Check values of the map for a webelement that has a matching id attribute.
getCheckboxMap().forEach((k,v) -> {
// If the value's attribute matches expected id, then the key webelement should be clicked since the child cannot.
if(v.getAttribute("id").equals(checkboxIdToClick) k.click()
});
private Map<WebElement,WebElement> getCheckboxMap() {
@seleniumgists
seleniumgists / file.m
Created August 14, 2020 05:58
generated automatically from #selenium on seleniumhq slack
// The id of the checkbox we intend to click.
final String checkboxIdToClick = new String("363171428_2399318203")
// Check values of the map for a webelement that has a matching id attribute.
getCheckboxMap().forEach((k,v) -> {
// If the value's attribute matches expected id, then the key webelement should be clicked since the child cannot.
if(v.getAttribute("id").equals(checkboxIdToClick) k.click()
});
private Map<WebElement,WebElement> getCheckboxMap() {
@seleniumgists
seleniumgists / file.css
Created August 14, 2020 05:06
generated automatically from #selenium on seleniumhq slack
div.checkbox-button-container:nth-of-type(2)
@seleniumgists
seleniumgists / file.m
Created August 13, 2020 21:19
generated automatically from #selenium on seleniumhq slack
Caused by: org.openqa.selenium.json.JsonException: Unable to determine type from: <. Last 1 characters read: <
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'ip-192-168-49-63', ip: '192.168.49.63', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-1100-aws', java.version: '1.8.0_265'
@seleniumgists
seleniumgists / file.m
Created August 12, 2020 10:34
generated automatically from #selenium on seleniumhq slack
>>> https://{HIDDEN}@hub-cloud.browserstack.com/wd/hub/session | {"capabilities":{"firstMatch":[{"bstack:options":{"buildName":"OTHER ","projectName":"Public-Website-Cucumber tests","sessionName":"CI tests called from locally","os":"Windows","osVersion":"10","local":"false","seleniumVersion":"3.141.59","debug":"false","consoleLogs":"verbose","networkLogs":"false","ie":{"driver":"3.141.59"}},"browserName":"internet_explorer","browserVersion":"11","se:ieOptions":{"nativeEvents":true,"enablePersistentHover":true}}]}}