I am writing UI tests on a new feature. This feature is iframed in, and appears in all browser configuration except for incognito with third party cookies blocked. I have created a new browser settings option that I can call to run the test suite locally "BROWSER=iframe_present rspec --tag service:test_tag" or the test itself "BROWSER=iframe_present rspec spec/service_folder/example_test_spec.rb".
My goal is to set it up so that only this test file; or service tag ("test_tag") run with the specific browser configuration when automatically through a travis configuration (which I can test locally by running "BROWSER=headless rspec spec/service_folder/example_test_spec.rb").
I've tried to call the 'iframe_present' browser configuration from the test file in a few different ways, but each one hits the byebug I have in the final 'else' browser condition. Perhaps I need to use the ci.travis.sh file? Seems to deal with picking the browser config.
*edit to include spec_helper.rb file
example_test_spec.rb
describe "Validating HQ Extensions menu item", type: :feature, service: "sales_channels1" do
context "Squadlocker" do
# different attempts
# let(:browser_config) { SeleniumTest.browser == iframe_present }
# BROWSER=iframe_present
# before(:all) { SeleniumTest.ENV["BROWSER"] == "iframe_present" }
# before { SeleniumTest.stub(ENV["BROWSER"] => "iframe_present") }
# before { SeleniumTest.stub(ENV["BROWSER"] == "iframe_present") }
before do
allow(ENV).to receive(:[])
.with("BROWSER").and_return("iframe_present")
end
let(:hq_home) { HqHomePage.new }
let(:marketplace) { MarketplacePage.new }
it "some condition check" do
# stuff
end
end
end
env.rb
require 'uri'
require 'capybara/poltergeist'
require 'selenium-webdriver'
require 'webdrivers'
require_relative '../../config/api_config_base'
module SeleniumTest
module_function
# url stuff, unrelated
browser = ENV['BROWSER'] ? ENV['BROWSER'].downcase : ''
puts "browser type: #{browser}"
if browser == 'firefox'
# options
RSpec.configure do |config|
config.before :each do
page.driver.browser.manage.window.maximize
end
end
elsif browser == 'headless'
Capybara.default_driver = :selenium_chrome_headless
Capybara.register_driver :selenium_chrome_headless do |app|
options = Selenium::WebDriver::Chrome::Options.new
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-gpu')
options.add_argument('--incognito')
Capybara::Selenium::Driver.new(
app,
browser: :chrome,
capabilities: [options]
)
end
elsif browser == 'iframe_present'
byebug
# currently matching chrome settings for testing minus incognito setting, will switch to headless
Capybara.default_driver = :selenium_chrome
Capybara.register_driver :selenium_chrome do |app|
options = Selenium::WebDriver::Chrome::Options.new
options.add_argument('--no-sandbox')
options.add_argument('--disable-gpu')
Capybara::Selenium::Driver.new(
app,
browser: :chrome,
capabilities: [options]
)
end
else
byebug
Capybara.default_driver = :selenium_chrome
Capybara.register_driver :selenium_chrome do |app|
options = Selenium::WebDriver::Chrome::Options.new
options.add_argument('--no-sandbox')
options.add_argument('--disable-gpu')
Capybara::Selenium::Driver.new(
app,
browser: :chrome,
capabilities: [options]
)
end
RSpec.configure do |config|
config.before :each do
page.driver.browser.manage.window.maximize
end
end
Capybara.javascript_driver = :chrome
end
ci.travis.sh
source ./script/env.travis.sh
echo $TEST_TAG
echo $RSPEC_TAG
echo $BROWSER
echo $TRAVIS_BRANCH
if [[ $TRAVIS_BRANCH == "main" ]]; then
BROWSER=headless ./run_spec_tests.sh "production" "Rspec UI Tests" \
"$TRAVIS_BUILD_NUMBER" "$TEST_AUTOMATION_NOTIFY_CHANNEL" \
"$TEST_AUTOMATION_NOTIFY_CHANNEL" "$AUTHOR_NAME" "" "$RSPEC_TAG" "$BROWSER"
elif [[ $TRAVIS_BRANCH != "testdrive" ]]; then
BROWSER=headless ./run_spec_tests.sh "staging" "Rspec UI Tests" \
"$TRAVIS_BUILD_NUMBER" "$TEST_AUTOMATION_NOTIFY_CHANNEL" \
"$TEST_AUTOMATION_NOTIFY_CHANNEL" "$AUTHOR_NAME" "" "$RSPEC_TAG" "$BROWSER"
fi
spec_helper.rb file
require "capybara/rspec"
require "etc"
Dir[File.dirname(__FILE__) + "/support/*.rb"].each { |f| require f }
Dir[File.dirname(__FILE__) + "/helpers/*.rb"].each { |f| require f }
Dir[File.dirname(__FILE__) + "/page_models/*.rb"].each { |f| require f }
RSpec.configure do |config|
config.include FactoryBot::Syntax::Methods
config.include AffiliateRosteringHelper, type: :feature
config.include AffiliationsHelper, type: :feature
config.include AllureAttachmentHelper
config.include ApiRequestHelper
config.include CSVHelper
config.include DateTimeHelper, type: :feature
config.include UserHelper
config.include Capybara::DSL
# Use color in STDOUT
config.color = true
# Use color not only in STDOUT but also in pagers and files
config.tty = true
config.before(:suite) do
FactoryBot.find_definitions
end
config.formatter = :documentation
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
config.shared_context_metadata_behavior = :apply_to_host_groups
config.filter_run_when_matching :focus
config.before(:each, type: :feature) do
Capybara.current_session.driver.browser.manage.window.resize_to(1500, 1600)
end
if ApiConfigBase.env === 'production'
Capybara.default_max_wait_time = 30
else
Capybara.default_max_wait_time = 45
end
Capybara.raise_server_errors = true
config.verbose_retry = true
config.display_try_failure_messages = true
config.around :each do |ex|
ex.run_with_retry retry: 0 # set back to 3 b4 code review
end
config.formatter = AllureRspecFormatter if ENV["TRAVIS"]
if !ENV["TRAVIS"]
# Instructions on getting your secrets.json file here:
# https://sportngin.atlassian.net/wiki/spaces/DEV/pages/2913271865/Credentials+in+Parameter+Store
JSON.parse(File.read("secrets.json")).each do |key, value|
ENV[key.upcase] = value
end
end
config.after(:each, type: :feature) do |example|
# restart browser sessions for every test
attach_screenshot(example) if ENV["TRAVIS"]
driver = Capybara.current_session.driver
if driver.is_a?(Capybara::Selenium::Driver)
driver.quit
elsif driver.is_a?(Capybara::Poltergeist::Driver)
driver.browser.restart
end
end
end
If I'm understanding correctly, I believe you need the following in your test:
before do
allow(ENV).to receive(:[])
.with("BROWSER").and_return("iframe_present")
end
I have an InfluxDB Version 1.8.9, but I can't start it.
In this example I'm logged in as a root.
netstat -lptn
gives me a range of services, none of them seem to listen to 8086. (there are other services running like grafana or MySQL, which seem to work fine)
To further confirm nothing is on 8086,I listened to that related Issue run: open server: open service: listen tcp :8086: bind: address already in use on starting influxdb
and run
netstat -a | grep 8086
which results in no results.
My config file on /etc/influxdb/influxdb.conf looks like this:
reporting-disabled = false
bind-address = "127.0.0.1:8086"
[meta]
#dir = "/root/.influxdb/meta"
dir = "/var/lib/influxdb/meta"
retention-autocreate = true
logging-enabled = true
[data]
dir = "/var/lib/influxdb/data"
index-version = "inmem"
wal-dir = "/var/lib/influxdb/wal"
wal-fsync-delay = "0s"
validate-keys = false
strict-error-handling = false
query-log-enabled = true
cache-max-memory-size = 1073741824
cache-snapshot-memory-size = 26214400
cache-snapshot-write-cold-duration = "10m0s"
compact-full-write-cold-duration = "4h0m0s"
compact-throughput = 50331648
compact-throughput-burst = 50331648
max-series-per-database = 1000000
max-values-per-tag = 100000
max-concurrent-compactions = 0
max-index-log-file-size = 1048576
series-id-set-cache-size = 100
series-file-max-concurrent-snapshot-compactions = 0
trace-logging-enabled = false
tsm-use-madv-willneed = false
...
[http]
enabled = true
bind-address = ":8086"
auth-enabled = false
log-enabled = true
suppress-write-log = false
write-tracing = false
flux-enabled = false
flux-log-enabled = false
pprof-enabled = true
pprof-auth-enabled = false
debug-pprof-enabled = false
ping-auth-enabled = false
prom-read-auth-enabled = false
https-enabled = false
https-certificate = "/etc/ssl/influxdb.pem"
https-private-key = ""
max-row-limit = 0
max-connection-limit = 0
shared-secret = ""
realm = "InfluxDB"
unix-socket-enabled = false
unix-socket-permissions = "0777"
bind-socket = "/var/run/influxdb.sock"
max-body-size = 25000000
access-log-path = ""
max-concurrent-write-limit = 0
max-enqueued-write-limit = 0
enqueued-write-timeout = 30000000000
...
So i tried to start my database:
service influxdb start
Which gives me
ob for influxdb.service failed because a timeout was exceeded. See
"systemctl status influxdb.service" and "journalctl -xe" for details.
result of systemctl status influxdb.service
● influxdb.service - InfluxDB is an open-source, distributed, time series database
Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled)
Active: activating (start) since Tue 2021-09-21 18:37:12 CEST; 1min 7s ago
Docs: https://docs.influxdata.com/influxdb/
Main PID: 32016 (code=exited, status=1/FAILURE); Control PID: 5874 (influxd-systemd)
Tasks: 2 (limit: 4915)
CGroup: /system.slice/influxdb.service
├─5874 /bin/bash -e /usr/lib/influxdb/scripts/influxd-systemd-start.sh
└─5965 sleep 10
Sep 21 18:37:23 s22227708 influxd-systemd-start.sh[5874]: ts=2021-09-21T16:37:23.515897Z lvl=info msg="Registered diagnostics client" log_id=0WjJLI7l000 service=monitor name=runtime
Sep 21 18:37:23 s22227708 influxd-systemd-start.sh[5874]: ts=2021-09-21T16:37:23.515907Z lvl=info msg="Registered diagnostics client" log_id=0WjJLI7l000 service=monitor name=network
Sep 21 18:37:23 s22227708 influxd-systemd-start.sh[5874]: ts=2021-09-21T16:37:23.515923Z lvl=info msg="Registered diagnostics client" log_id=0WjJLI7l000 service=monitor name=system
Sep 21 18:37:23 s22227708 influxd-systemd-start.sh[5874]: ts=2021-09-21T16:37:23.515977Z lvl=info msg="Starting precreation service" log_id=0WjJLI7l000 service=shard-precreation check_interval=10m advanc
Sep 21 18:37:23 s22227708 influxd-systemd-start.sh[5874]: ts=2021-09-21T16:37:23.515995Z lvl=info msg="Starting snapshot service" log_id=0WjJLI7l000 service=snapshot
Sep 21 18:37:23 s22227708 influxd-systemd-start.sh[5874]: ts=2021-09-21T16:37:23.516015Z lvl=info msg="Starting continuous query service" log_id=0WjJLI7l000 service=continuous_querier
Sep 21 18:37:23 s22227708 influxd-systemd-start.sh[5874]: ts=2021-09-21T16:37:23.516011Z lvl=info msg="Storing statistics" log_id=0WjJLI7l000 service=monitor db_instance=_internal db_rp=monitor interval=
Sep 21 18:37:23 s22227708 influxd-systemd-start.sh[5874]: ts=2021-09-21T16:37:23.516037Z lvl=info msg="Starting HTTP service" log_id=0WjJLI7l000 service=httpd authentication=false
Sep 21 18:37:23 s22227708 influxd-systemd-start.sh[5874]: ts=2021-09-21T16:37:23.516052Z lvl=info msg="opened HTTP access log" log_id=0WjJLI7l000 service=httpd path=stderr
Sep 21 18:37:23 s22227708 influxd-systemd-start.sh[5874]: run: open server: open service: listen tcp :8086: bind: address already in use
I can't really understand where I did something wrong, since I configured :8086 in the config file. Can you help me?
It appears to be a typo in the configuration file.
As stated in the documentation, the configuration file should hold http-bind-address instead of bind-address. As well as a locked port by the first configuration.
The first few lines of the file /etc/influxdb/influxdb.conf should look like so:
reporting-disabled = false
http-bind-address = "127.0.0.1:8086"
A suggested approach would be to:
bind-address to http-bind-address
Changing the port from default 8086 to a known free port
(Optional) Back to the default port.
From your config:
reporting-disabled = false
bind-address = "127.0.0.1:8086"
...
[http]
enabled = true
bind-address = ":8086"
Both your 'native' service and the 'http' service are configured to use the same port 8086. This cannot work and you probably want to change the 'native' port back to its default of 8088.
I am using geb spock framework which was working excellent with Selenium 2.52.0 and I was able to launch different browsers with different languages. For that I have written below GebConfig.groovy file.
When I upgraded selenium version to 3.3.1 and Firefox version as 56, I am not able to execute test cases on Firefox. Browser is getting launched however not able to load the url and getting below errors. I have tried several methods, however for time being please refer below GebConfig.groovy and error details:
GebCOnfig.groovy
/*
This is the Geb configuration file.
See: http://www.gebish.org/manual/current/configuration.html
*/
import com.gargoylesoftware.htmlunit.BrowserVersion
import com.gargoylesoftware.htmlunit.WebClient
import org.openqa.selenium.Platform
import org.openqa.selenium.WebDriver
import org.openqa.selenium.chrome.ChromeDriver
import org.openqa.selenium.chrome.ChromeOptions
import org.openqa.selenium.firefox.FirefoxDriver
import org.openqa.selenium.firefox.FirefoxOptions
import org.openqa.selenium.firefox.FirefoxProfile
import org.openqa.selenium.htmlunit.HtmlUnitDriver
import org.openqa.selenium.ie.InternetExplorerDriver
import org.openqa.selenium.remote.CapabilityType
import org.openqa.selenium.remote.DesiredCapabilities
import org.openqa.selenium.remote.RemoteWebDriver
import java.util.logging.Level
import java.util.logging.Logger
/*
1) For testing on different browsers, On Edit Configurations provide VM Options = -ea -Dgeb.env=<BROWSER_NAME>
2) For testing from command prompt by using maven command, run the command :
mvn -Dgeb.env=<BROWSER_NAME> -Dtest=<TEST_CASE_NAME_WITHOUT_EXTENSION > test
Note: <BROWSER_NAME> = "firefox" or "chrome" or "ie" or "htmlunit"
<TEST_CASE_NAME_WITHOUT_EXTENSION> example: eSuite_MP_CON_09_Zoek_in_kennisbank_PDC */
//FUNCTIONAL SETTINGS
def final DEFAULT_BROWSER = "firefox" //"chrome" or "firefox" or "ie" or "htmlunit"
def final BASE_URL = "https://india.westernunion.com/WUCOMWEB/signInAction.do?method=load"
def final DEFAULT_LANGUAGE = "nl" //"en" or "nl"
def final REPORT_DIR = 'target/reports'
def final DEFAULT_DOWNLOAD_PATH = "C://Users/IEUser/Downloads/"
def final USERNAMEAPP = "Testbeheerder" //was "Beheerder"
def final PASSWORDAPP = "March#2017" //was "Jan#2017"
//TECHNICAL SETTINGS
def final WAITFOR_TIMEOUT = 50
def final WAITFOR_RETRY = 0.5
def final WAIT_AT_KEYWORD_AT = true
def final WAIT_TIME = 1000
def browser = System.getProperty("geb.env")
//Default browser
if (!correctBrowser(browser)) {
browser = DEFAULT_BROWSER
}
def envLang = System.getProperty("geb.env.lang")
//Default language
if (!correctLanguage(envLang)) {
envLang = DEFAULT_LANGUAGE
}
System.setProperty("geb.env.lang", envLang)
System.setProperty("geb.build.baseUrl", BASE_URL);
System.setProperty("geb.build.beheer.baseUrl", BASE_URL_BEHEER);
System.setProperty("geb.build.loket.baseUrl", BASE_URL_LOKET);
System.setProperty("geb.wait.time", WAIT_TIME.toString());
System.setProperty("geb.download.path", DEFAULT_DOWNLOAD_PATH);
System.setProperty("usernameapp", USERNAMEAPP);
System.setProperty("passwordapp", PASSWORDAPP);
System.setProperty("penguinusername", PENGUINUSERNAME);
System.setProperty("penguinpassword", PENGUINPASSWORD);
System.setProperty("geb.env", browser)
System.setProperty("USERNAME", USERNAME);
System.setProperty("DATABASE", DATABASE);
System.setProperty("HOSTNAME", HOSTNAME);
System.setProperty("PGPASSWORD", PGPASSWORD);
if (Platform.LINUX.equals(Platform.getCurrent())) {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/chromedriver-2.15-linux64");
} else {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/chromedriver.exe");
//System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/chromedriver-2.15_win32.exe");
}
//System.setProperty("webdriver.ie.driver", "src/test/resources/drivers/IEDriverServer-2.45.0_Win32_.exe");
System.setProperty("webdriver.ie.driver", "src/test/resources/drivers/IEDriverServer.exe");
System.setProperty("webdriver.gecko.driver", "src/test/resources/drivers/geckodriver.exe");
environments {
driver = { getDriver(browser, envLang) }
}
/**
* Returns the browser specific WebDriver
* #param browser Browser name
* #return WebDriver
*/
private WebDriver getDriver(def browser, def language) {
if ("chrome".equalsIgnoreCase(browser)) {
DesiredCapabilities chromeCapabilities = DesiredCapabilities.chrome();
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--start-maximized");
Map<String, Object> prefs = new HashMap<String, Object>();
prefs.put("intl.accept_languages", language);
chromeOptions.setExperimentalOption("prefs", prefs);
chromeCapabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions)
def chromeDriver = new ChromeDriver(chromeCapabilities)
chromeDriver.manage().window().maximize()
chromeDriver
} else if ("firefox".equalsIgnoreCase(browser)) {
// Case 1: which was working earlier
FirefoxProfile profile = new FirefoxProfile()
profile.setPreference("intl.accept_languages", language)
def firefoxDriver = new FirefoxDriver(profile)
firefoxDriver.manage().window().maximize()
firefoxDriver
// Case 2 :
/*FirefoxOptions options = new FirefoxOptions().setLogLevel(Level.OFF)
def firefoxDriver = new FirefoxDriver(options)
firefoxDriver.manage().window().maximize()
firefoxDriver*/
// Case 3 :
/*DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
def firefoxDriver = new RemoteWebDriver(capabilities);
firefoxDriver.manage().window().maximize()
firefoxDriver*/
} else if ("ie".equalsIgnoreCase(browser)) {
/**
* For InternetExplorer: In order to set the browser language to 'EN' or 'NL',
* Go to, Settings -> Internet Options -> General ->
* - Click on the button 'Languages'
* - In the Language text box,
* Add the desired language "Dutch (Netherlands) [nl-NL]" or "English (United States) [en-US]"
* and move it up by clicking 'Move up' button
*
*/
DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer()
ieCapabilities.setCapability(InternetExplorerDriver.ENABLE_PERSISTENT_HOVERING, false)
ieCapabilities.setCapability(InternetExplorerDriver.REQUIRE_WINDOW_FOCUS, false)
ieCapabilities.setCapability(InternetExplorerDriver.UNEXPECTED_ALERT_BEHAVIOR, true)
ieCapabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true)
ieCapabilities.setCapability(CapabilityType.HAS_NATIVE_EVENTS, true)
ieCapabilities.setCapability(InternetExplorerDriver.ENABLE_ELEMENT_CACHE_CLEANUP, true);
ieCapabilities.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true);
ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true)
ieCapabilities.setJavascriptEnabled(true);
def ieDriver = new InternetExplorerDriver(ieCapabilities)
ieDriver.manage().window().maximize()
ieDriver
} else if ("htmlunit".equalsIgnoreCase(browser)) {
WebDriver htmlUnitDriver = new HtmlUnitDriver() {
protected WebClient modifyWebClient(WebClient client) {
client = new WebClient(BrowserVersion.CHROME);
client.getOptions().setUseInsecureSSL(true);
client.getOptions().setThrowExceptionOnScriptError(false);
return client;
}
};
BrowserVersion.CHROME.setBrowserLanguage(language.toString())
// Turn off htmlunit warnings
Logger.getLogger("com.gargoylesoftware.htmlunit").setLevel(Level.OFF);
Logger.getLogger("org.apache.http").setLevel(Level.OFF);
htmlUnitDriver.setJavascriptEnabled(true);
htmlUnitDriver.manage().window().maximize()
htmlUnitDriver
}
}
/**
* Checks if the browser name provided is the correct one
* #param browser Browser name
* #return boolean
*/
private boolean correctBrowser(def browser) {
boolean result = true;
if (null == browser || (!"chrome".equalsIgnoreCase(browser) && !"firefox".equalsIgnoreCase(browser) && !"ie".equalsIgnoreCase(browser) && !"htmlunit".equalsIgnoreCase(browser))) {
result = false;
}
return result;
}
/**
* Check if the language provided is the correct one
* #param lang Language
* #return boolean
*/
private boolean correctLanguage(def lang) {
boolean result = true;
if (null == lang || (!"en".equalsIgnoreCase(lang) && !"nl".equalsIgnoreCase(lang))) {
result = false;
}
return result;
}
waiting {
timeout = WAITFOR_TIMEOUT
retryInterval = WAITFOR_RETRY
}
atCheckWaiting = WAIT_AT_KEYWORD_AT
reportsDir = REPORT_DIR
Error Description:
"C:\Program Files\Java\jdk1.8.0_131\bin\java" -ea -Dgeb.build.reportsDir=target/test-reports/geb -Didea.test.cyclic.buffer.size=1048576 "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.2.3\lib\idea_rt.jar=52849:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.2.3\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.2.3\lib\idea_rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.2.3\plugins\junit\lib\junit-rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.2.3\plugins\junit\lib\junit5-rt.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\rt.jar;C:\DurgeshProjectWork\Workspace\IdeaProjects\wu_bdd_geb\target\test-classes;C:\Users\acer\.m2\repository\org\spockframework\spock-core\1.0-groovy-2.4\spock-core-1.0-groovy-2.4.jar;C:\Users\acer\.m2\repository\junit\junit\4.12\junit-4.12.jar;C:\Users\acer\.m2\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;C:\Users\acer\.m2\repository\org\gebish\geb-spock\2.1\geb-spock-2.1.jar;C:\Users\acer\.m2\repository\org\codehaus\groovy\groovy-all\2.4.7\groovy-all-2.4.7.jar;C:\Users\acer\.m2\repository\org\gebish\geb-core\2.1\geb-core-2.1.jar;C:\Users\acer\.m2\repository\org\gebish\geb-ast\2.1\geb-ast-2.1.jar;C:\Users\acer\.m2\repository\org\gebish\geb-waiting\2.1\geb-waiting-2.1.jar;C:\Users\acer\.m2\repository\org\gebish\geb-implicit-assertions\2.1\geb-implicit-assertions-2.1.jar;C:\Users\acer\.m2\repository\org\gebish\geb-exceptions\2.1\geb-exceptions-2.1.jar;C:\Users\acer\.m2\repository\org\jodd\jodd-lagarto\3.7.1\jodd-lagarto-3.7.1.jar;C:\Users\acer\.m2\repository\org\jodd\jodd-core\3.7.1\jodd-core-3.7.1.jar;C:\Users\acer\.m2\repository\org\jodd\jodd-log\3.7.1\jodd-log-3.7.1.jar;C:\Users\acer\.m2\repository\org\gebish\geb-test-common\2.1\geb-test-common-2.1.jar;C:\Users\acer\.m2\repository\org\seleniumhq\selenium\selenium-java\3.3.1\selenium-java-3.3.1.jar;C:\Users\acer\.m2\repository\org\seleniumhq\selenium\selenium-chrome-driver\3.3.1\selenium-chrome-driver-3.3.1.jar;C:\Users\acer\.m2\repository\org\seleniumhq\selenium\selenium-remote-driver\3.3.1\selenium-remote-driver-3.3.1.jar;C:\Users\acer\.m2\repository\org\seleniumhq\selenium\selenium-api\3.3.1\selenium-api-3.3.1.jar;C:\Users\acer\.m2\repository\cglib\cglib-nodep\3.2.4\cglib-nodep-3.2.4.jar;C:\Users\acer\.m2\repository\org\apache\commons\commons-exec\1.3\commons-exec-1.3.jar;C:\Users\acer\.m2\repository\com\google\guava\guava\21.0\guava-21.0.jar;C:\Users\acer\.m2\repository\net\java\dev\jna\jna-platform\4.1.0\jna-platform-4.1.0.jar;C:\Users\acer\.m2\repository\net\java\dev\jna\jna\4.1.0\jna-4.1.0.jar;C:\Users\acer\.m2\repository\org\seleniumhq\selenium\selenium-edge-driver\3.3.1\selenium-edge-driver-3.3.1.jar;C:\Users\acer\.m2\repository\org\seleniumhq\selenium\selenium-firefox-driver\3.3.1\selenium-firefox-driver-3.3.1.jar;C:\Users\acer\.m2\repository\org\seleniumhq\selenium\selenium-ie-driver\3.3.1\selenium-ie-driver-3.3.1.jar;C:\Users\acer\.m2\repository\org\seleniumhq\selenium\selenium-opera-driver\3.3.1\selenium-opera-driver-3.3.1.jar;C:\Users\acer\.m2\repository\org\seleniumhq\selenium\selenium-safari-driver\3.3.1\selenium-safari-driver-3.3.1.jar;C:\Users\acer\.m2\repository\com\codeborne\phantomjsdriver\1.4.0\phantomjsdriver-1.4.0.jar;C:\Users\acer\.m2\repository\org\seleniumhq\selenium\htmlunit-driver\2.24\htmlunit-driver-2.24.jar;C:\Users\acer\.m2\repository\org\seleniumhq\selenium\selenium-support\3.9.1\selenium-support-3.9.1.jar;C:\Users\acer\.m2\repository\net\bytebuddy\byte-buddy\1.7.9\byte-buddy-1.7.9.jar;C:\Users\acer\.m2\repository\com\squareup\okhttp3\okhttp\3.9.1\okhttp-3.9.1.jar;C:\Users\acer\.m2\repository\com\squareup\okio\okio\1.13.0\okio-1.13.0.jar;C:\Users\acer\.m2\repository\net\sourceforge\htmlunit\htmlunit\2.24\htmlunit-2.24.jar;C:\Users\acer\.m2\repository\xalan\xalan\2.7.2\xalan-2.7.2.jar;C:\Users\acer\.m2\repository\xalan\serializer\2.7.2\serializer-2.7.2.jar;C:\Users\acer\.m2\repository\org\apache\commons\commons-lang3\3.5\commons-lang3-3.5.jar;C:\Users\acer\.m2\repository\org\apache\httpcomponents\httpmime\4.5.2\httpmime-4.5.2.jar;C:\Users\acer\.m2\repository\net\sourceforge\htmlunit\htmlunit-core-js\2.23\htmlunit-core-js-2.23.jar;C:\Users\acer\.m2\repository\net\sourceforge\htmlunit\neko-htmlunit\2.24\neko-htmlunit-2.24.jar;C:\Users\acer\.m2\repository\xerces\xercesImpl\2.11.0\xercesImpl-2.11.0.jar;C:\Users\acer\.m2\repository\xml-apis\xml-apis\1.4.01\xml-apis-1.4.01.jar;C:\Users\acer\.m2\repository\net\sourceforge\cssparser\cssparser\0.9.21\cssparser-0.9.21.jar;C:\Users\acer\.m2\repository\org\w3c\css\sac\1.3\sac-1.3.jar;C:\Users\acer\.m2\repository\commons-io\commons-io\2.5\commons-io-2.5.jar;C:\Users\acer\.m2\repository\org\eclipse\jetty\websocket\websocket-client\9.2.20.v20161216\websocket-client-9.2.20.v20161216.jar;C:\Users\acer\.m2\repository\org\eclipse\jetty\jetty-util\9.2.20.v20161216\jetty-util-9.2.20.v20161216.jar;C:\Users\acer\.m2\repository\org\eclipse\jetty\jetty-io\9.2.20.v20161216\jetty-io-9.2.20.v20161216.jar;C:\Users\acer\.m2\repository\org\eclipse\jetty\websocket\websocket-common\9.2.20.v20161216\websocket-common-9.2.20.v20161216.jar;C:\Users\acer\.m2\repository\org\eclipse\jetty\websocket\websocket-api\9.2.20.v20161216\websocket-api-9.2.20.v20161216.jar;C:\Users\acer\.m2\repository\com\google\code\gson\gson\2.3.1\gson-2.3.1.jar;C:\Users\acer\.m2\repository\org\apache\httpcomponents\httpclient\4.3.4\httpclient-4.3.4.jar;C:\Users\acer\.m2\repository\org\apache\httpcomponents\httpcore\4.3.2\httpcore-4.3.2.jar;C:\Users\acer\.m2\repository\commons-logging\commons-logging\1.1.3\commons-logging-1.1.3.jar;C:\Users\acer\.m2\repository\commons-codec\commons-codec\1.6\commons-codec-1.6.jar;C:\Users\acer\.m2\repository\com\googlecode\json-simple\json-simple\1.1.1\json-simple-1.1.1.jar" com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit4 specs.sprintOne.TC_001_LoginSample_spec
1520759641134 geckodriver INFO geckodriver 0.19.1
1520759641140 geckodriver INFO Listening on 127.0.0.1:8942
1520759642011 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\acer\\AppData\\Local\\Temp\\rust_mozprofile.jGPMmTbag3iw"
1520759642327 addons.xpi WARN Error parsing extensions state: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [amIAddonManagerStartup.readStartupData]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: resource://gre/modules/addons/XPIProvider.jsm :: loadExtensionState :: line 1554" data: no] Stack trace: loadExtensionState()#resource://gre/modules/addons/XPIProvider.jsm:1554 < getInstallState()#resource://gre/modules/addons/XPIProvider.jsm:1589 < checkForChanges()#resource://gre/modules/addons/XPIProvider.jsm:3109 < startup()#resource://gre/modules/addons/XPIProvider.jsm:2188 < callProvider()#resource://gre/modules/AddonManager.jsm:269 < _startProvider()#resource://gre/modules/AddonManager.jsm:739 < startup()#resource://gre/modules/AddonManager.jsm:906 < startup()#resource://gre/modules/AddonManager.jsm:3090 < observe()#jar:file:///C:/Program%20Files/Mozilla%20Firefox/omni.ja!/components/addonManager.js:65
1520759643229 Marionette INFO Enabled via --marionette
Unable to read VR Path Registry from C:\Users\acer\AppData\Local\openvr\openvrpaths.vrpath
[Child 10700] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
[Child 10700] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
1520759645835 Marionette INFO Listening on port 52856
1520759646171 Marionette DEBUG Register listener.js for window 6442450945
1520759646375 geckodriver INFO geckodriver 0.19.1
1520759646387 geckodriver INFO Listening on 127.0.0.1:5497
1520759646950 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\acer\\AppData\\Local\\Temp\\rust_mozprofile.WwKvyKDi21YC"
1520759647155 addons.xpi WARN Error parsing extensions state: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [amIAddonManagerStartup.readStartupData]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: resource://gre/modules/addons/XPIProvider.jsm :: loadExtensionState :: line 1554" data: no] Stack trace: loadExtensionState()#resource://gre/modules/addons/XPIProvider.jsm:1554 < getInstallState()#resource://gre/modules/addons/XPIProvider.jsm:1589 < checkForChanges()#resource://gre/modules/addons/XPIProvider.jsm:3109 < startup()#resource://gre/modules/addons/XPIProvider.jsm:2188 < callProvider()#resource://gre/modules/AddonManager.jsm:269 < _startProvider()#resource://gre/modules/AddonManager.jsm:739 < startup()#resource://gre/modules/AddonManager.jsm:906 < startup()#resource://gre/modules/AddonManager.jsm:3090 < observe()#jar:file:///C:/Program%20Files/Mozilla%20Firefox/omni.ja!/components/addonManager.js:65
1520759647895 Marionette INFO Enabled via --marionette
1520759650640 Marionette INFO Listening on port 52883
1520759651100 Marionette DEBUG Register listener.js for window 6442450945
geb.driver.DriverCreationException: failed to create driver from callback 'script15207596390172071282656$_run_closure1$_closure3#51768776'
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:85)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy)
at geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:32)
at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:84)
at geb.Configuration.createDriver(Configuration.groovy:382)
at geb.Configuration.getDriver(Configuration.groovy:371)
at geb.Browser.getDriver(Browser.groovy:111)
at geb.navigator.factory.BrowserBackedNavigatorFactory.<init>(BrowserBackedNavigatorFactory.groovy:35)
at geb.Configuration.createNavigatorFactory(Configuration.groovy:417)
at geb.Browser.createNavigatorFactory(Browser.groovy:133)
at geb.Browser.getNavigatorFactory(Browser.groovy:121)
at geb.Page.init(Page.groovy:144)
at geb.Browser.createPage(Browser.groovy:859)
at geb.Browser.to(Browser.groovy:550)
at geb.Browser.to(Browser.groovy:539)
at geb.spock.GebSpec.methodMissing(GebSpec.groovy:56)
at specs.sprintOne.TC_001_LoginSample_spec.Step 0: Properties laden(TC_001_LoginSample_spec.groovy:14)
Caused by: org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{moz:firefoxOptions={binary=Optional.empty, args=[], legacy=null, logLevel=null, prefs={}, profile=org.openqa.selenium.firefox.FirefoxProfile#36676c1a}, firefox_profile=org.openqa.selenium.firefox.FirefoxProfile#36676c1a}], required capabilities = Capabilities [{moz:firefoxOptions={binary=Optional.empty, args=[], legacy=null, logLevel=null, prefs={}, profile=org.openqa.selenium.firefox.FirefoxProfile#36676c1a}, firefox_profile=org.openqa.selenium.firefox.FirefoxProfile#36676c1a}]
Build info: version: '3.3.1', revision: '5234b325d5', time: '2017-03-10 09:10:29 +0000'
System info: host: 'DESKTOP-KMHBAIB', ip: '192.168.220.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_131'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:604)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:244)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:218)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:137)
at script15207596390172071282656.getDriver(script15207596390172071282656.groovy:131)
at script15207596390172071282656.run_closure1$_closure3(script15207596390172071282656.groovy:103)
at script15207596390172071282656.run_closure1$_closure3(script15207596390172071282656.groovy)
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:29)
... 17 more
1520759651155 geckodriver INFO geckodriver 0.19.1
1520759651162 geckodriver INFO Listening on 127.0.0.1:7479
1520759651750 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\acer\\AppData\\Local\\Temp\\rust_mozprofile.gGnTCVSPMRcn"
1520759651983 addons.xpi WARN Error parsing extensions state: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [amIAddonManagerStartup.readStartupData]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: resource://gre/modules/addons/XPIProvider.jsm :: loadExtensionState :: line 1554" data: no] Stack trace: loadExtensionState()#resource://gre/modules/addons/XPIProvider.jsm:1554 < getInstallState()#resource://gre/modules/addons/XPIProvider.jsm:1589 < checkForChanges()#resource://gre/modules/addons/XPIProvider.jsm:3109 < startup()#resource://gre/modules/addons/XPIProvider.jsm:2188 < callProvider()#resource://gre/modules/AddonManager.jsm:269 < _startProvider()#resource://gre/modules/AddonManager.jsm:739 < startup()#resource://gre/modules/AddonManager.jsm:906 < startup()#resource://gre/modules/AddonManager.jsm:3090 < observe()#jar:file:///C:/Program%20Files/Mozilla%20Firefox/omni.ja!/components/addonManager.js:65
1520759652660 Marionette INFO Enabled via --marionette
Unable to read VR Path Registry from C:\Users\acer\AppData\Local\openvr\openvrpaths.vrpath
[Child 12052] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
[Child 12052] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
1520759655598 Marionette INFO Listening on port 52919
1520759655906 Marionette DEBUG Register listener.js for window 4294967297
geb.driver.DriverCreationException: failed to create driver from callback 'script15207596390172071282656$_run_closure1$_closure3#51768776'
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:85)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy)
at geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:32)
at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:84)
at geb.Configuration.createDriver(Configuration.groovy:382)
at geb.Configuration.getDriver(Configuration.groovy:371)
at geb.Browser.getDriver(Browser.groovy:111)
at geb.report.PageSourceReporter.getPageSource(PageSourceReporter.groovy:42)
at geb.report.PageSourceReporter.writePageSource(PageSourceReporter.groovy:38)
at geb.report.PageSourceReporter.writeReport(PageSourceReporter.groovy:29)
at geb.report.CompositeReporter.writeReport(CompositeReporter.groovy:31)
at geb.Browser.report(Browser.groovy:931)
at geb.spock.GebReportingSpec.report(GebReportingSpec.groovy:59)
at geb.spock.GebReportingSpec.cleanup(GebReportingSpec.groovy:46)
Caused by: org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{moz:firefoxOptions={binary=Optional.empty, args=[], legacy=null, logLevel=null, prefs={}, profile=org.openqa.selenium.firefox.FirefoxProfile#1827a871}, firefox_profile=org.openqa.selenium.firefox.FirefoxProfile#1827a871}], required capabilities = Capabilities [{moz:firefoxOptions={binary=Optional.empty, args=[], legacy=null, logLevel=null, prefs={}, profile=org.openqa.selenium.firefox.FirefoxProfile#1827a871}, firefox_profile=org.openqa.selenium.firefox.FirefoxProfile#1827a871}]
Build info: version: '3.3.1', revision: '5234b325d5', time: '2017-03-10 09:10:29 +0000'
System info: host: 'DESKTOP-KMHBAIB', ip: '192.168.220.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_131'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:604)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:244)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:218)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:137)
at script15207596390172071282656.getDriver(script15207596390172071282656.groovy:131)
at script15207596390172071282656.run_closure1$_closure3(script15207596390172071282656.groovy:103)
at script15207596390172071282656.run_closure1$_closure3(script15207596390172071282656.groovy)
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:29)
... 14 more
Can you please guide me on this front, because my requirement is very specific to launch browser in multiple languages as well. The GebConfig file is working fine for chrome.
Thanks
I am able to resolve this issue by performing below settings:
Selenium version : 3.6.0
Firefox Version: 56.0
Geckodriver version : 0.19.1
Then performed below changes in GebConfig.groovy
FirefoxOptions options = new FirefoxOptions().setLogLevel(Level.OFF)
options.addArguments("incognito")
def firefoxDriver = new FirefoxDriver(options)
firefoxDriver.manage().window().maximize()
firefoxDriver
Firefox launched successfully.
Thanks for your help on this.
I met a really weird issue: I'm able to connect to my SQL Server with tsql but I'm not able to do the same with pymssql. Let me give you more details.
With this kind of tsql command everything seems to be ok:
$ tsql -H '10.10.10.2' -U 'DOMAIN\myuser' -p 63849
Password:
locale is "fr_FR.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
1>
But with the following basic python script I got an issue:
$ cat test_mssql.py
# -*- coding: utf8 -*-
import pymssql
import pandas as pd
conn = pymssql.connect(server=r'10.10.10.2', user=r'DOMAIN\myuser', password='mypassword', port='63849')
$ python test_mssql.py
Traceback (most recent call last):
File "api-vinci-rh/current/test_mssql.py", line 60, in <module>
conn = pymssql.connect(server=r'10.10.10.2', user=r'DOMAIN\myuser', password='mypassword', port='63849')
File "pymssql.pyx", line 641, in pymssql.connect (pymssql.c:10788)
pymssql.OperationalError: (20002, 'DB-Lib error message 20002, severity 9:\nAdaptive Server connection failed\n')
By activating TDSDUMPCONFIG env variable, I can see a difference between the tls command and my python script:
TDSDUMPCONFIG tls trace
config.c:224:Final connection parameters:
config.c:225: server_name = 10.10.10.2
config.c:226: server_host_name = 10.10.10.2
config.c:227: ip_addr = 10.10.10.2
config.c:228: instance_name =
config.c:229: port = 63849
config.c:230: major_version = 7
config.c:231: minor_version = 1
config.c:232: block_size = 0
config.c:233: language = us_english
config.c:234: server_charset =
config.c:235: connect_timeout = 0
config.c:236: client_host_name = myhost
config.c:237: client_charset = UTF-8
config.c:238: app_name = TSQL
config.c:239: user_name = DOMAIN\myuser
config.c:242: library = TDS-Library
config.c:243: bulk_copy = 0
config.c:244: suppress_language = 0
config.c:245: encrypt level = 0
config.c:246: query_timeout = 0
config.c:249: database =
config.c:250: dump_file = /tmp/freetds.log
config.c:251: debug_flags = 0
TDSDUMPCONFIG pymssql trace
config.c:224:Final connection parameters:
config.c:225: server_name = 10.10.10.2:63849
config.c:226: server_host_name = 10.10.10.2
config.c:227: ip_addr = 10.10.10.2
config.c:228: instance_name =
config.c:229: port = 63849
config.c:230: major_version = 7
config.c:231: minor_version = 1
config.c:232: block_size = 0
config.c:233: language = us_english
config.c:234: server_charset =
config.c:235: connect_timeout = 0
config.c:236: client_host_name = myhost
config.c:237: client_charset = UTF-8
config.c:238: app_name = pymssql=2.1.2
config.c:239: user_name =
config.c:242: library = DB-Library
config.c:243: bulk_copy = 0
config.c:244: suppress_language = 0
config.c:245: encrypt level = 0
config.c:246: query_timeout = 0
config.c:249: database =
config.c:250: dump_file = /tmp/freetds.log
config.c:251: debug_flags = 0
config.c:252: text_size = 64512
config.c:253: broken_dates = 0
config.c:254: emul_little_endian = 0
config.c:255: server_realm_name =
I think the 2 main differences is about the user_name which is empty with the python script and the library which is DB-Library instead of TDS-Library.
I currently find no way to force these parameters in the python script and I find no clue about my issue (the error message is a generic one).
I'm using python 2.7.9 and pymssql==2.1.2
More info about my env:
$ tsql -C
Compile-time settings (established with the "configure" script)
Version: freetds v0.91
freetds.conf directory: /etc/freetds
MS db-lib source compatibility: no
Sybase binary compatibility: yes
Thread safety: yes
iconv library: yes
TDS version: 4.2
iODBC: no
unixodbc: yes
SSPI "trusted" logins: no
Kerberos: yes
$ grep -v '^#' /etc/freetds/freetds.conf
[global]
tds version = 7.1
dump file = /tmp/freetds.log
text size = 64512
enable gssapi delegation = off
If you have any clue to help let me know.
Edit: I have another SQL Server instance for my test and my python script works... the username in the TDSDUMPCONFIG is set. So Iguess there is something strange on my env but don't know what
I find a clue and I'm quite surprised byt it... If I use a username with less than 32 characters, I have no more issue with pymssql ! I didn't find anything about this weird bug (?) but I promess it fixes my issue.
I need to see the code of pymssql and see if I find any lenght restriction or issue about the lenght of the username
I seem to be having an issue with the pro bono tac_plus configuration.
my switch is giving me the following log message
May 4 20:58:52 sv5-c1-r104-ae02 Aaa: %AAA-4-EXEC_AUTHZ_FAILED: User jdambly failed authorization to start a shell
if I look at the tac_plus logs it looks like my group mapping is not configured correctly, here is the log
May 4 14:04:22 neteng tac_plus[14476]: 1/9a920270: Start authorization request
May 4 14:04:22 neteng tac_plus[14476]: 1/9a920270: cfg_get: checking user/group jdambly, tag (NULL)
May 4 14:04:22 neteng tac_plus[14476]: 1/9a920270: cfg_get: checking user/group jdambly, tag (NULL)
May 4 14:04:22 neteng tac_plus[14476]: 1/9a920270: user 'jdambly' found
May 4 14:04:22 neteng tac_plus[14476]: 1/9a920270: cfg_get: checking user/group jdambly, tag (NULL)
May 4 14:04:22 neteng tac_plus[14476]: 1/9a920270: jdambly#192.168.0.19: not found: svcname=shell#world protocol=
May 4 14:04:22 neteng tac_plus[14476]: 1/9a920270: jdambly#192.168.0.19: not found: svcname=shell protocol=
May 4 14:04:22 neteng tac_plus[14476]: 1/9a920270: jdambly#192.168.0.19: svcname=shell protocol= not found, default is <unknown>
May 4 14:04:22 neteng tac_plus[14476]: 1/9a920270: Writing AUTHOR/FAIL size=18
here is my config
id = tac_plus {
debug = PACKET AUTHEN AUTHOR MAVIS
access log = /var/log/tac_plus/access.log
accounting log = /var/log/tac_plus/acct.log
authorization log = /var/log/tac_plus/auth.log
mavis module = external {
setenv LDAP_SERVER_TYPE = "microsoft"
#setenv LDAP_HOSTS = "ldaps://xxxxxx:3268"
setenv LDAP_HOSTS = "xxxxxx:3268"
setenv LDAP_SCOPE = sub
setenv LDAP_BASE = "dc=nskope,dc=net"
setenv LDAP_FILTER = "(&(objectclass=user)(sAMAccountName=%s))"
setenv LDAP_USER = "xxxx#nskope.net"
setenv LDAP_PASSWD = "xxxxxxxx"
#setenv AD_GROUP_PREFIX = devops
# setenv REQUIRE_AD_GROUP_PREFIX = 1
# setenv USE_TLS = 0
exec = /usr/local/lib/mavis/mavis_tacplus_ldap.pl
}
user backend = mavis
login backend = mavis
pap backend = mavis
skip missing groups = yes
host = world {
address = 0.0.0/0
prompt = "Welcome\n"
key = cisco
}
group = devops {
default service = permit
service = shell {
default command = permit
default attribute = permit
set priv-lvl = 15
}
}
}
I'm trying to map the ad group devops to the group in the config but I think that's failing and I don't get why
so LONG story short I got this working using the following config.
#!../../../sbin/tac_plus
id = spawnd {
listen = { port = 49 }
spawn = {
instances min = 1
instances max = 10
}
background = no
}
id = tac_plus {
debug = PACKET AUTHEN AUTHOR MAVIS
access log = /var/log/tac_plus/access.log
accounting log = /var/log/tac_plus/acct.log
authorization log = /var/log/tac_plus/auth.log
mavis module = external {
setenv LDAP_SERVER_TYPE = "microsoft"
#setenv LDAP_HOSTS = "ldaps://xxxxxxxxx:3268"
setenv LDAP_HOSTS = "xxxxxxxxx:3268"
#setenv LDAP_SCOPE = sub
setenv LDAP_BASE = "cn=Users,dc=nskope,dc=net"
setenv LDAP_FILTER = "(&(objectclass=user)(sAMAccountName=%s))"
setenv LDAP_USER = "xxxxxxxx"
setenv LDAP_PASSWD = "xxxxxxxx"
#setenv FLAG_FALLTHROUGH=1
setenv UNLIMIT_AD_GROUP_MEMBERSHIP = "1"
#setenv EXPAND_AD_GROUP_MEMBERSHIP=1
#setenv FLAG_USE_MEMBEROF = 1
setenv AD_GROUP_PREFIX = ""
# setenv REQUIRE_AD_GROUP_PREFIX = 1
# setenv USE_TLS = 0
exec = /usr/local/lib/mavis/mavis_tacplus_ldap.pl
}
user backend = mavis
login backend = mavis
pap backend = mavis
skip missing groups = yes
host = world {
address = 0.0.0/0
#prompt = "Welcome\n"
key = cisco
}
group = devops {
default service = permit
service = shell {
default command = permit
default attribute = permit
set priv-lvl = 15
}
}
}
what really did the trick is adding
setenv UNLIMIT_AD_GROUP_MEMBERSHIP = "1"
setenv AD_GROUP_PREFIX = ""
with these settings it's not looking for a prefix to the all the ad groups. This config allows for a direct mappings of ad group to the group configured in this file, in my case the group is called dev ops. also note that I had to use quotes around the 1. without these quests it does not set the var UNLIMIT_AD_GROUP_MEMBERSHIP to one so watch out for that. hopefully this can help someone else so they do not have to go through all the pain I did ;)