我这里有一个Selenium Hub和一个带有Config的Selenium节点:
14:02:03.874 INFO - Got a request to create a new session: Capabilities [{browserName=safari, safari.options={technologyPreview=true, port=0, cleanSession=true}, version=, platform=MAC}]
14:02:03.898 INFO - Trying to create a new session on test slot {seleniumProtocol=WebDriver, webdriver.safari.driver=/Applications/Safari Technology Preview.app/Contents/MacOS/safaridriver, browserName=safari, maxInstances=1, version=10, platform=MAC}
如果我尝试使用代码从Maven项目开始测试:
java -jar C:\selenium\selenese-runner.jar --driver remote --remote-url http://<ip>:4444/wd/hub --remote-platform MAC --remote-browser "safari" --define "safari.options={technologyPreview=true, port=0, cleanSession=true}" --screenshot-on-fail C:\selenium\screenshot --max-time 600 --baseurl %1 %2
在MAC上,Safari技术预览开始没有问题。 Selenium Hub日志:
14:05:26.088 INFO - Got a request to create a new session: Capabilities [{browserName=safari, safari.options={technologyPreview=true, port=0, cleanSession=true}, version=, platform=MAC}]
14:05:26.102 INFO - Trying to create a new session on test slot {seleniumProtocol=WebDriver, webdriver.safari.driver=/Applications/Safari Technology Preview.app/Contents/MacOS/safaridriver, browserName=safari, maxInstances=1, version=10, platform=MAC}
现在我想用Selenese Runner Java和
开始id="question{qnum+1}_option1"
Seleniu Hub上的日志是相同的:
<div className="col s4">
<div className="card light-red">
<div className="card-content blue-text">
<span className="card-title"><div className="row"><div className="input-field col s12"><input id="question{qnum+1}_question" type="text" className="validate" /><label htmlFor="Question {qnum+1}">Question {(qnum + 1).toString()}</label></div></div></span>
<p>
<div className="row">
<div className="input-field col s6"><input id="question{qnum+1}_option1" type="text" className="validate" /><label htmlFor="question{qnum+1}_option1">Option 1</label></div>
<div className="input-field col s6"><input id="question{qnum+1}_option2" type="text" className="validate" /><label htmlFor="question{qnum+1}_option2">Option 2</label></div>
<div className="input-field col s6"><input id="question{qnum+1}_option3" type="text" className="validate" /><label htmlFor="question{qnum+1}_option3">Option 3</label></div>
<div className="input-field col s6"><input id="question{qnum+1}_option4" type="text" className="validate" /><label htmlFor="question{qnum+1}_option4">Option 4</label></div>
</div>
</p>
</div>
</div>
</div>
但是在Selenium节点上启动了Safari(非技术预览版)实例。
不同之处在于,使用safariOption类发送safari.option,并使用纯文本发送它。
我无法理解为什么会有不同之处。
你有什么想法吗?
谢谢!
连身