onSuggestSelect(suggest) {
if (!suggest.gmaps) {
return;
}
const components = suggest.gmaps.address_components;
const address = {
street: this.findAddressComponent(components, 'street_number', 'short_name') + ' ' + this.findAddressComponent(components, 'route', 'short_name'),
city: this.findAddressComponent(components, 'locality', 'short_name'),
state: this.findAddressComponent(components, 'administrative_area_level_1', 'short_name'),
zip: this.findAddressComponent(components, 'postal_code', 'short_name'),
}
this.setState({
address
});
}
findAddressComponent(components, type, version) {
const address = components.find(function(component) {
return (component.types.indexOf(type) !== -1);
});
return address[version];
}
错误:线程“主”中的异常org.openqa.selenium.WebDriverException:未知错误:元素...在点(352,560)不可单击。其他元素将获得点击:
答案 0 :(得分:0)
看起来像它的readonly
字段。我尝试过JavaScript Executor
来设置值。
请尝试以下代码,看看是否有帮助。
JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript("document.getElementById('hp-widget__depart').value='2 Mar,Fri';");
OR
WebElement elementdept=driver.findElement(By.xpath("//input[@mt-id='departDate']"));
elementdept.click();
driver.findElement(By.cssSelector("a.ui-state-active")).click();