我正在为我的应用编写自动化测试。谷歌浏览器上的测试运行正常。但是当我在Internet Explorer 11上运行它们时,它们的运行速度非常慢。当我在chrome上运行它们时,一个测试用例在将近5分钟内完成。但是在IE11上,我已经运行了一个测试案例近3个小时,测试只是第2步。我试过跟随它来加快速度
任何人都可以指导我如何更快地使我的测试用例?我的应用程序是用AngularJS编写的,我没有任何访问App代码的权限。我只能在测试方面做得更快。
答案 0 :(得分:0)
请参阅此github评论: https://github.com/SeleniumHQ/selenium-google-code-issue-archive/issues/5116#issuecomment-192106534
*我认为这可能是个问题,或者
可能是javascript正在创建问题,尝试在测试期间禁用它并查看是否有帮助
并尝试此代码,
import UIKit
import Charts
class SecondViewController: UIViewController, ChartViewDelegate{
var controllerName:String?
@IBOutlet weak var pChartViewA: PieChartView!
@IBOutlet weak var pChartViewB: PieChartView!
@IBOutlet weak var pChartViewC: PieChartView!
@IBOutlet weak var pChartViewD: PieChartView!
override func viewDidLoad() {
super.viewDidLoad()
self.pChartViewA.delegate = self
// self.pChartViewB.delegate = self
//self.pChartViewC.delegate = self
// self.pChartViewD.delegate = self
self.pChartViewA.alpha = 1
//self.pChartView.delegate = self
// Pie Chart
pChartViewA.noDataText = "You need to provide data for the chart."
let pys1 = Array(1..<10).map { x in return sin(Double(x) / 2.0 / 3.141 * 1.5) * 100.0 }
let pyse1 = pys1.enumerated().map { x, y in return PieChartDataEntry(value: y, label: String(x)) }
let pdata = PieChartData()
let pds1 = PieChartDataSet(values: pyse1, label: "Hello")
pds1.colors = ChartColorTemplates.vordiplom()
pdata.addDataSet(pds1)
let paragraphStyle: NSMutableParagraphStyle = NSParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle
paragraphStyle.lineBreakMode = .byTruncatingTail
paragraphStyle.alignment = .center
let centerText: NSMutableAttributedString = NSMutableAttributedString(string: "Sample Screening Pie")
self.pChartViewA.centerAttributedText = centerText
self.pChartViewA.data = pdata
self.pChartViewA.chartDescription?.text = "Piechart Demo"
}
@IBAction func ChangeComponent(_ sender: AnyObject) {
if sender.selectedSegmentIndex == 0 {
UIView.animate(withDuration: 0.5, animations: {
self.pChartViewA.alpha = 1
self.pChartViewB.alpha = 0
self.pChartViewC.alpha = 0
self.pChartViewD.alpha = 0
// Pie Chart
self.pChartViewA.noDataText = "You need to provide data for the chart."
let pys1 = Array(1..<10).map { x in return sin(Double(x) / 2.0 / 3.141 * 1.5) * 100.0 }
let pyse1 = pys1.enumerated().map { x, y in return PieChartDataEntry(value: y, label: String(x)) }
let pdata = PieChartData()
let pds1 = PieChartDataSet(values: pyse1, label: "Hello")
pds1.colors = ChartColorTemplates.vordiplom()
pdata.addDataSet(pds1)
let paragraphStyle: NSMutableParagraphStyle = NSParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle
paragraphStyle.lineBreakMode = .byTruncatingTail
paragraphStyle.alignment = .center
let centerText: NSMutableAttributedString = NSMutableAttributedString(string: "Sample Screening Pie")
self.pChartViewA.centerAttributedText = centerText
self.pChartViewA.data = pdata
self.pChartViewA.chartDescription?.text = "Piechart Demo"
})
} else if sender.selectedSegmentIndex == 1 {
UIView.animate(withDuration: 0.5, animations: {
self.pChartViewA.alpha = 0
self.pChartViewB.alpha = 1
self.pChartViewC.alpha = 0
self.pChartViewD.alpha = 0
})
}
else if sender.selectedSegmentIndex == 2 {
UIView.animate(withDuration: 0.5, animations: {
self.pChartViewA.alpha = 0
self.pChartViewB.alpha = 0
self.pChartViewC.alpha = 1
self.pChartViewD.alpha = 0
})
}
else if sender.selectedSegmentIndex == 3 {
UIView.animate(withDuration: 0.5, animations: {
self.pChartViewA.alpha = 0
self.pChartViewB.alpha = 0
self.pChartViewC.alpha = 0
self.pChartViewD.alpha = 1
})
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
抱歉,我不熟悉python,请转换代码并尝试..
答案 1 :(得分:0)
我发现调用FindElements花了很长时间,只需在下方设置 InternetExplorerOptions 就可以加快速度。
var ieOptions = new InternetExplorerOptions();
ieOptions.EnablePersistentHover = false;