如何为makemytrip设置Auotmate组合框,因为我能够插入值但是一旦焦点被移动,值就会从组合框中删除

时间:2016-05-31 06:03:56

标签: vbscript qtp hp-uft

如何为makemytrip进行Auotmate组合框,因为我能够插入值但是一旦焦点被移动,值就会从组合框中删除

enter image description here

3 个答案:

答案 0 :(得分:1)

首先尝试使用Click(或WebEdit)对象WebElement。然后,使用SendKeys方法插入所需的值。这里的一个潜在问题是,即使您使用SendKeys,该值仍可能消失,如果是这样,请尝试逐个发送字符串。 Google提供了大量关于SendKeys的示例代码,并将一个字符串发送一个字符。

答案 1 :(得分:1)

如果它是WebEdit对象,您可能会发现如果您使用WebEdit("whateveritscalled").Type myDestinationString操作而非SetSendKeys,则效果最佳。

答案 2 :(得分:0)

尝试以下操作,我使用Elementid设置值,它应该有效 -

Browser("MakeMyTrip, India's No").Page("MakeMyTrip, India's No").Object.getElementById("from_typeahead1").value = "New Delhi, India (DEL)"
Browser("MakeMyTrip, India's No").Page("MakeMyTrip, India's No").Object.getElementById("to_typeahead1").value = "Mumbai, India (BOM)"