Selenium Ide - 选择选项

时间:2016-07-14 10:22:03

标签: selenium ide

我被困在这里:

https://www.otelo.de/handytarife/einsteiger-tarife/smartphone-100/page/2.html

我试图使用,例如xpath=//input[@data-name="Internet-Flat 750"] 确定选项,但它不起作用。

我做了什么:

<tr>
    <td>store</td>
    <td>${tarifoption}</td>
    <td>tarifoption</td>
</tr>
<tr>
    <td>store</td>
    <td>${tarifoption2}</td>
    <td>tarifoption2</td>
</tr>
<tr>
    <td>store</td>
    <td>${tarifoption3}</td>
    <td>tarifoption3</td>
</tr>
<tr>
    <td>if</td>
    <td>storedVars['tarifoption'&amp;&amp;'tarifoption2'&amp;&amp;'tarifoption3'].m‌​atch(/^keine$/);</td>
    <td></td>
</tr>
<tr>
    <td>clickAndWait</td>
    <td>css=input.btn.btn-primary</td>
    <td></td>
</tr>
<tr>
    <td>else</td>
    <td></td>
    <td></td>
</tr>

我想要的是如果没有选择所有3个选项,它将进入下一个屏幕并且我试图用storedvars

进行调整
storedVars['tarifoption','tarifoption2',tarifoption3'].match(/^keine$/);

谢谢!

1 个答案:

答案 0 :(得分:0)

使用

<?php
error_reporting(E_ALL);
header("Content-Type: text/html;charset=utf-8");

define('_PS_ADMIN_DIR_', getcwd());

include(_PS_ADMIN_DIR_.'/../config/config.inc.php');

include(_PS_ADMIN_DIR_.'/functions.php');

include_once '../controllers/admin/AdminImportController.php';

function loadProductsPost() {
$_POST = array (
'tab' => 'AdminImport',
'skip' => '1',
'csv' => 'conector.csv',
'forceIDs' => '0',
'match_ref' => '0',
'convert' => '',
'entity' => '1',
'separator' => ';',
'multiple_value_separator' => ',',
'iso_lang' => 'es',
'import' => 'Importar datos CSV',
'type_value' =>
    array (

0 => 'no',
1 => 'active',
2 => 'name',
3 => 'category',
4 => 'price_tin',
5 => 'id_tax_rules_group',
6 => 'reference',
7 => 'manufacturer',
8 => 'quantity',
9 => 'minimal_quantity',
10 => 'description_short',
11 => 'description',
12 => 'tags',
13 => 'meta_title',
14 => 'meta_keywords',
15 => 'meta_description',
16 => 'link_rewrite',
17 => 'available_now',
18 => 'available_for_order',
19 => 'date_add',
20 => 'show_price',
21 => 'image',
22 => 'delete_existing_images',
23 => 'online_only',
24 => 'condition',
25 => 'customizable',
26 => 'uploadable_files',
27 => 'text_fields',
28 => 'out_of_stock',
29 => 'shop',

    ),
  );
}

$import = New AdminImportController();

    loadProductsPost();

    $import->productImport();

    var_dump($import);


?>

标记为//label[@data-name="Internet-Flat 750"] 而不是label