Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何为extjs应用程序选择组合框项internet explorer?_Javascript_Perl_Combobox_Extjs_Selenium - Fatal编程技术网

Javascript 如何为extjs应用程序选择组合框项internet explorer?

Javascript 如何为extjs应用程序选择组合框项internet explorer?,javascript,perl,combobox,extjs,selenium,Javascript,Perl,Combobox,Extjs,Selenium,首先,下面的代码适用于我的非ie浏览器应用程序(我正在使用perl和selenium进行extjs测试): 不幸的是,如果我敢添加可见性条件,xpath库给出的xpath计数为零。页面内容会发生变化,因此首先我有一个组合框项目列表(我可以单击此列表),然后有两个列表。当我处理第二个列表时,会单击第一个列表项(它们具有相同的内容,并且没有可区分的id)。使用last()没有帮助 我尝试了无数不同的XPath,但无法从extjs中的第二个组合框中选择项目。selenium确实返回了正确的html源

首先,下面的代码适用于我的非ie浏览器应用程序(我正在使用perl和selenium进行extjs测试):

不幸的是,如果我敢添加可见性条件,xpath库给出的xpath计数为零。页面内容会发生变化,因此首先我有一个组合框项目列表(我可以单击此列表),然后有两个列表。当我处理第二个列表时,会单击第一个列表项(它们具有相同的内容,并且没有可区分的id)。使用last()没有帮助

我尝试了无数不同的XPath,但无法从extjs中的第二个组合框中选择项目。selenium确实返回了正确的html源代码,但我无法访问第二个组合框。如果我首先打开第二个组合,那么我无法选择第一个组合中的项目

在某种程度上,我曾希望这会奏效:

    if($comboindex==1)
    { 
        $locator="//div[contains(\@class, 'x-combo-list')]/descendant::div[contains(\@class, 'x-combo-list-item')][text()='".$combovalue."']";
    }
    else
    {
        $locator="//div[contains(\@class, 'x-combo-list')]/following::div[contains(\@class, 'x-combo-list-item')][text()='".$combovalue."']"; 
    }

但是它没有…

您可以尝试使用css选择器而不是xpath,本指南可能包含您需要的内容