getCoords.js
:var getCoords = function(selector, debug) {
var elem;
try {
elem = document.querySelector(selector);
// elem = document.getElementById(id);
} catch(e) {
}
var t =null;
if (elem != null){
t = elem.getBoundingClientRect();
if (debug) {
alert(JSON.stringify(t));
}
}
return JSON.stringify(t);
}
var selector = arguments[0] || '#text';
var debug = arguments[1];
return getCoords(selector, debug);
private static final String baseURL = "https://www.wikipedia.org/";
private static final String selector = "#searchInput";
// это все не работает пока
// private String baseURL = "https://ya.ru/";
// private String selector = "button.button"
// private String selector = "#text"
@Test(priority = 1, enabled = true)
public void openExtensionURLTest() {
driver.get(baseURL);
WebElement element = wait.until(ExpectedConditions
.visibilityOf(driver.findElement(By.cssSelector(selector))));
assertThat(element, notNullValue());
// на ya.ru даже здесь не бываем
String data = (String) super.executeScript(
super.getScriptContent("getCoords.js"), selector, false);
System.err.println(data);
}
Test Name: openExtensionURLTest
{"x":284.5874938964844,"y":445.82501220703125,"width":394.20001220703125,"height
":43.20000076293945,"top":445.82501220703125,"right":678.7875061035156,"bottom":
489.0250129699707,"left":284.5874938964844}
button.button
{"x":817.5,"y":305.6000061035156,"width":108,"height":46,"top":305.6000061035156
,"right":925.5,"bottom":351.6000061035156,"left":817.5}
"#text"
{"x":125.5,"y":305.6000061035156,"width":692,"height":46,"top":305.6000061035156
,"right":817.5,"bottom":351.6000061035156,"left":125.5}
cat b.conf
somethng else
<VirtualHost:9007>
<Directory>
# junk
foo
</Directory>
</VirtualHost>
somethng other
cp a.conf b.conf
sed -i '/<VirtualHost:9007/,/<\/Virtual/s/^ *[^#<].*$/bar/g' a.conf
diff a.conf b.conf
5c5
< bar
---
> foo
~/.docker
директории не было и нет и все работает это у вас думаю. which docker-credential-secretservice
/usr/bin/docker-credential-secretservice
dpkg -S docker-credential-secretservice
golang-docker-credential-helpers: /usr/bin/docker-credential-secretservice
~/.docker/config.json
вообще - что получится ?