Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/17.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
Html Jmeter webdriver的正则表达式_Html_Regex_Jmeter - Fatal编程技术网

Html Jmeter webdriver的正则表达式

Html Jmeter webdriver的正则表达式,html,regex,jmeter,Html,Regex,Jmeter,我目前正在使用JMeterWebDriver对web应用程序进行性能测试。我试图点击页面上的一个按钮,但这是在几个框架下。问题是一个帧,它改变了每个会话的名称。这是HTML代码: <iframe frameborder="0" id="iframe3970-45593-1439460248299" tabindex="-1" src="https://grcrep.fiatitem.com/BOE/portal/1508131050/AnalyticalReporting/WebiView

我目前正在使用JMeterWebDriver对web应用程序进行性能测试。我试图点击页面上的一个按钮,但这是在几个框架下。问题是一个帧,它改变了每个会话的名称。这是HTML代码:

<iframe frameborder="0" id="iframe3970-45593-1439460248299" tabindex="-1" src="https://grcrep.fiatitem.com/BOE/portal/1508131050/AnalyticalReporting/WebiView.do?bypassLatestInstance=true&amp;cafWebSesInit=true&amp;bttoken=MDAwREcwXFo2V25vZk00QTtoS1xiUko5Y2Y6T11qOzAEQ&amp;bttoken=MDAwREcwXFo2V25vZk00QTtoS1xiUko5Y2Y6T11qOzAEQ&amp;opendocTarget=infoviewOpenDocFrame&amp;appKind=InfoView&amp;service=%2FInfoView%2Fcommon%2FappService.do&amp;loc=en&amp;pvl=en_US&amp;ctx=standalone&amp;actId=3970&amp;objIds=45593&amp;containerId=45589&amp;pref=maxOpageU%3D50%3BmaxOpageUt%3D200%3BmaxOpageC%3D10%3Btz%3DEurope%2FBerlin%3BmUnit%3Dinch%3BshowFilters%3Dtrue%3BsmtpFrom%3Dtrue%3BpromptForUnsavedData%3Dtrue%3B&amp;tidtime=3970-45593-1439460248299" style="width: 1600px; height: 703px;"></iframe>
...
    <iframe id="webiViewFrame" name="webiViewFrame" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" style="margin:0px;position:absolute;left:0px;top:0px;width:100%;height:100%" src="webiDHTML/dhtmllib/empty.html"></iframe>
...
       <div id="IconImg_iconMenu_icon__dhtmlLib_268" class="imo" style="width:16px;height:16px;background-image:url('images/main/galleries/icon16x16gallery1b.png');background-position:0px -208px;margin-top:2px;cursor:pointer"></div>

...
...
我想用
id=IconImg\u iconMenu\u icon\u dhtmlLib\u 268单击按钮

它位于iframe webiViewFrame和iframe
iframe3970-45593-1439460248299
下。最后一帧在每个会话中更改名称。唯一固定的部分是
iframe3970-
。如何定位此元素。我尝试过使用正则表达式
WDS.browser.findElement(pkg.By.id(“iframe3970-“+”([0-9]+?)”))
,但它不起作用

尝试使用以文本前缀开头的id定位iframe:

  WDS.browser.findElement(pkg.By.cssSelector("iframe[id^='iframe3970-']"))  

为什么不
findElement(By.id(“IconImg\u iconMenu\u icon\u dhtmlLib\u 268”)
为什么父id相关?谢谢,这就是我要找的