我计划使用Selenium WebDriver自动化Canvas报告(jqcharts,xyplot,条形图,饼图)。
在说明工作之前,我正在阅读关于报告自动化的论坛上的评论,所以我想我应该对以下问题得到一些反馈:
是否有人在使用selenium webdriver自动化jqcharts方面取得了成功?
如果是这样,您在自动化图表时遇到的主要挑战是什么,以及如何克服这些挑战?
请查找附件样本xy章程也附上报告的DOM(参考ReportDom.xml
)
报告的DOM
<div style="height: 400px; width: 800px; position: relative;" id="chartView" class="jqplot-target"><canvas width="800" height="400" style="position: absolute; left: 0px; top: 0px;" class="jqplot-base-canvas"></canvas><div class="jqplot-title" style="position: absolute; top: 0px; left: 0px; width: 800px; text-align: left;">Process Instances</div><div style="position: absolute; width: 800px; height: 43px; left: 0px; bottom: 0px;" class="jqplot-axis jqplot-xaxis"><div class="jqplot-xaxis-label" style="position: absolute; left: 403.5px; bottom: 0px;">Priority</div><canvas width="23" height="15" style="width: 23px; height: 15px; text-align: left; position: absolute; left: 175.167px;" class="jqplot-xaxis-tick"></canvas><canvas width="46" height="15" style="width: 46px; height: 15px; text-align: left; position: absolute; left: 405px;" class="jqplot-xaxis-tick"></canvas><canvas width="27" height="15" style="width: 27px; height: 15px; text-align: left; position: absolute; left: 655.833px;" class="jqplot-xaxis-tick"></canvas></div><div class="jqplot-axis jqplot-yaxis" style="position: absolute; height: 400px; width: 56px; left: 0px; top: 0px;"><div class="jqplot-yaxis-label" style="position: absolute; width: 49px; top: 177px; left: 0px;">Count</div><canvas width="7" height="15" style="width: 7px; height: 15px; text-align: left; position: absolute; top: 339.5px;" class="jqplot-yaxis-tick"></canvas><canvas width="7" height="15" style="width: 7px; height: 15px; text-align: left; position: absolute; top: 293.5px;" class="jqplot-yaxis-tick"></canvas><canvas width="7" height="15" style="width: 7px; height: 15px; text-align: left; position: absolute; top: 247.5px;" class="jqplot-yaxis-tick"></canvas><canvas width="7" height="15" style="width: 7px; height: 15px; text-align: left; position: absolute; top: 201.5px;" class="jqplot-yaxis-tick"></canvas><canvas width="7" height="15" style="width: 7px; height: 15px; text-align: left; position: absolute; top: 155.5px;" class="jqplot-yaxis-tick"></canvas><canvas width="7" height="15" style="width: 7px; height: 15px; text-align: left; position: absolute; top: 109.5px;" class="jqplot-yaxis-tick"></canvas><canvas width="7" height="15" style="width: 7px; height: 15px; text-align: left; position: absolute; top: 63.5px;" class="jqplot-yaxis-tick"></canvas><canvas width="7" height="15" style="width: 7px; height: 15px; text-align: left; position: absolute; top: 17.5px;" class="jqplot-yaxis-tick"></canvas></div><canvas width="800" height="400" class="jqplot-grid-canvas" style="position: absolute; left: 0px; top: 0px;"></canvas><canvas width="724" height="322" style="position: absolute; left: 66px; top: 25px;" class="jqplot-series-shadowCanvas"></canvas><canvas width="724" height="322" style="position: absolute; left: 66px; top: 25px;" class="jqplot-series-canvas"></canvas><div class="jqplot-cursor-tooltip" style="position: absolute; right: 16px; bottom: 59px; display: none;"></div><canvas width="724" height="322" style="position: absolute; left: 66px; top: 25px;" class="jqplot-highlight-canvas"></canvas><div class="jqplot-highlighter-tooltip" style="position: absolute; display: none;"></div><canvas width="724" height="322" style="position: absolute; left: 66px; top: 25px;" class="jqplot-lineRenderer-highlight-canvas"></canvas><canvas width="724" height="322" style="position: absolute; left: 66px; top: 25px; cursor: crosshair;" class="jqplot-event-canvas"></canvas><table style="position: absolute; font-size: 11px; z-index: 3; left: 790px; top: 161.5px;" class="jqplot-table-legend"><tbody><tr class="jqplot-table-legend"><td class="jqplot-table-legend jqplot-table-legend-swatch jqplot-seriesToggle" style="text-align: center; padding-top: 0px;"><div class="jqplot-table-legend-swatch-outline"><div class="jqplot-table-legend-swatch" style="background-color: rgb(75, 178, 197); border-color: rgb(75, 178, 197);"></div></div></td><td class="jqplot-table-legend jqplot-table-legend-label jqplot-seriesToggle" style="padding-top: 0px;">Series 1</td></tr></tbody></table></div>