我正在使用此代码:
profile = webdriver.FirefoxProfile()
profile.set_preference("network.proxy.type", 1)
profile.set_preference("network.proxy.http", "proxy.server.address")
profile.set_preference("network.proxy.http_port", "port_number")
profile.update_preferences()
driver = webdriver.Firefox(firefox_profile=profile)
Run Code Online (Sandbox Code Playgroud)
在python webdriver中设置FF的代理.这适用于FF.如何在Chrome中设置这样的代理?我发现这个例子但不是很有帮助.当我运行脚本时没有任何反应(Chrome浏览器未启动).
我正在尝试从Jenkins ssh到本地服务器,但抛出以下错误:
[SSH] Exception:Algorithm negotiation fail
com.jcraft.jsch.JSchException: Algorithm negotiation fail
at com.jcraft.jsch.Session.receive_kexinit(Session.java:520)
at com.jcraft.jsch.Session.connect(Session.java:286)
at com.jcraft.jsch.Session.connect(Session.java:150)
at org.jvnet.hudson.plugins.SSHSite.createSession(SSHSite.java:141)
at org.jvnet.hudson.plugins.SSHSite.executeCommand(SSHSite.java:151)
at org.jvnet.hudson.plugins.SSHBuildWrapper.executePreBuildScript(SSHBuildWrapper.java:75)
at org.jvnet.hudson.plugins.SSHBuildWrapper.setUp(SSHBuildWrapper.java:59)
at hudson.model.Build$BuildExecution.doRun(Build.java:154)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533)
at hudson.model.Run.execute(Run.java:1754)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Finished: FAILURE
Run Code Online (Sandbox Code Playgroud)
SSH服务器上安装的Java版本:
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
Run Code Online (Sandbox Code Playgroud)
客户端上安装的java版本:
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
Run Code Online (Sandbox Code Playgroud)
还尝试了这个解决方案: JSchException:算法协商失败 但它不起作用.从腻子一切似乎都没问题.建立连接,但是当我触发Jenkins作业时,会抛出错误.我应该尝试另一个版本的ssh服务器.现在我正在使用copssh.
考虑以下INI文件:
[TestSettings]
# First comment goes here
environment = test
[Browser]
# Second comment goes here
browser = chrome
chromedriver = default
...
Run Code Online (Sandbox Code Playgroud)
我正在使用Python 2.7来更新ini文件:
config = ConfigParser.ConfigParser()
config.read(path_to_ini)
config.set('TestSettings','environment',r'some_other_value')
with open(path_to_ini, 'wb') as configfile:
config.write(configfile)
Run Code Online (Sandbox Code Playgroud)
如何在不删除注释的情况下更新INI文件.INI文件已更新,但注释已删除.
[TestSettings]
environment = some_other_value
[Browser]
browser = chrome
chromedriver = default
Run Code Online (Sandbox Code Playgroud) 具有以下语句:
SELECT * INTO ZZZD FROM P4978
Run Code Online (Sandbox Code Playgroud)
输出:
result
time written
1970-01-01T00:00:00Z 231
Run Code Online (Sandbox Code Playgroud)
使用方法:
SELECT * FROM ZZZD
Run Code Online (Sandbox Code Playgroud)
即使那里写了231行,我也只能得到7行。我不知道为什么只有7行。是否有某些设置或这是缺陷?我不能从一个度量复制到另一个度量超过7行。
具有以下代码:
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
days, impressions = np.loadtxt('results_history.csv', unpack=True, delimiter=',',usecols=(0,1) ,
converters={ 0: mdates.strpdate2num('%d-%m-%y')})
plt.plot_date(x=days, y=impressions, fmt="r-")
plt.title("Load Testing Results")
#params = {'legend.labelsize': 500,
#'legend.handletextpad': 1,
#'legend.handlelength': 2,
#'legend.loc': 'upper left',
#'labelspacing':0.25,
#'legend.linewidth': 50}
#plt.rcParams.update(params)
plt.legend("response times")
plt.ylabel("Date")
plt.grid(True)
plt.show()
Run Code Online (Sandbox Code Playgroud)
图表已生成,但我不知道如何添加一些 xy 标签。生成的图:
还尝试增加图例文本大小,但未显示文本。并且来自 X 轴的标签是重叠的。CSV 文件:
01-05-14, 55494, Build 1
10-05-14, 55000, Build 2
15-05-14, 55500, Build 3
20-05-14, 57482, Build 4
25-05-14, 58741, Build 5
Run Code Online (Sandbox Code Playgroud)
如何从 csv 添加 xytext …
我有以下POST请求,这是从C#完成的:
POST http://192.168.123.27:8086/write?db=HWDB HTTP/1.1
Content-Type: text/plain; charset=utf-8
Host: 192.168.123.27:8086
Content-Length: 97
Expect: 100-continue
Connection: Keep-Alive
HARDWARE,CPU=1 count=91i 1456298998307783936
HARDWARE,CPU=2 count=92i 1456298998307783936
Run Code Online (Sandbox Code Playgroud)
我想用CURL做同样的请求.我正在使用以下命令:
curl -i -XPOST http://192.168.123.27:8086/write?db=HWDB --data-binary "HARDWARE,CPU="1" value=91, CPU="2" value=92 1422568543702900257"
Run Code Online (Sandbox Code Playgroud)
这将返回错误:
{"error":"unable to parse 'HARDWARE,CPU=1 value=91i, CPU=2 value=92i 1422568543702900257': invalid field format"}
Run Code Online (Sandbox Code Playgroud)
我应该如何更改CURL命令?我正在从Windows运行CURL,如果我使用:
curl -i -XPOST http://192.168.123.27:8086/write?db=HWDB --data-binary "HARDWARE,CPU=1 value=91"
Run Code Online (Sandbox Code Playgroud)
数据正确插入数据库中.还尝试使用InfluxDB文档中的示例从文件插入:
curl -i -XPOST http://192.168.123.27:8086/write?db=HDWB --data-binary @data.txt
Run Code Online (Sandbox Code Playgroud)
这将返回:
{"error":"partial write:\nunable to parse 'cpu_load_short,host=server02 value=0.
67\r': invalid number\nunable to parse 'cpu_load_short,host=server02,region=us-w
est value=0.55 1422568543702900257\r': bad timestamp"}
Run Code Online (Sandbox Code Playgroud)
data.txt的内容:
cpu_load_short,host=server02 value=0.67 …Run Code Online (Sandbox Code Playgroud) 如何将多个值(使用正则表达式提取器提取这些值)添加到参数中.
我有以下测试:

使用正则表达式提取器,我得到以下内容:

现在我正在使用包含以下代码的BeanShell PreProcessor:
int count = Integer.parseInt(vars.get("articleID_matchNr"));
for(int i=1;i<=count;i++) { //regex counts are 1 based
sampler.addArgument("articleIds", "[" + vars.get("articleID_" + i) + "]");
}
Run Code Online (Sandbox Code Playgroud)
使用它将生成以下请求:

这将添加多个具有相同名称的参数(articleIds),这将导致我在运行测试时出错.参数的正确形式应该是:
articleIds=["148437", "148720"]
Run Code Online (Sandbox Code Playgroud)
articleIds的数量因用户而异.