clear_text对我不起作用。有谁知道webview / cordova应用程序的不同方法?我正在使用的定位器是“webView css:'input#username'”但这似乎没问题,因为enter_text正在工作。
有什么建议吗?
谢谢, 路易斯。
答案 0 :(得分:1)
谢谢,但set_text("webView css:'input#username'", "")
没有用。我最终使用了您提到的解决方案here
感谢。
答案 1 :(得分:0)
//to hold the published product id which has vriation.
$has_variable_ids = [];
$args_parent = [
'post_type' => ['product'],
'post_status' => 'publish',
'posts_per_page' => -1
];
$pubished_post = new WP_Query($args_parent);
if (!empty($pubished_post->posts))
{
foreach ($pubished_post->posts as $post)
{
$_product = wc_get_product($post->ID);
if ($_product->is_type('variable'))
{
// Product has variations
$has_variable_ids[] = $post->ID;
}
}
}
$args = [
'post_type' => ['product_variation'],
'orderby' => 'meta_value_num',
'order' => 'DESC',
'post_status' => 'publish',
'post_parent__in' => $has_variable_ids,
'meta_query' => [
[
'key' => 'attribute_pa_flower-type',
'value' => $flower_type,
'compare' => '=',
]
]
];
$the_query = new WP_Query($args);
您也可以尝试使用WebView JavaScript API
答案 2 :(得分:0)
当我遇到类似的问题时,我最终使用了这样的东西:
Then /^I clear a field with "([^\"]*)" text$/ do |name|
name = set_value name
element = query("UITextFieldLabel text: '#{name}'")[0]
touch(element)
wait_for_keyboard
name.to_s.split('').each do |c|
keyboard_enter_char 'Delete'
end
end
详情请点击此处:Clear field with calabash-ios