Robotframework-硒库问题以及Internet Explorer

问题描述

我正在使用robotframework使用IE11和seleniumlibrary执行Web自动化。它在Windows 10工作站上运行。 我使用32位IE驱动程序3.14.0,因为它可以在屏幕锁定时运行脚本。

我收到了很多无效的选择器异常,这些异常导致测试失败。选择器有时工作良好,一段时间后会失败。库版本有问题吗?该驱动程序位于项目根文件夹中,并且所有必需的IE设置均可用。

我正在通过文件将元素作为变量提供给机器人。 例如:home='''//a[@href="http://example.com/example/example?abc=Home"]'''

示例错误

InvalidSelectorException: Message: Unable to locate an element with the xpath expression //a[@href="http://example.com/example/example?abc=Home"] because of the following error:
[object Error]

==

 <html>
    <head>
        <title></title>
        <script>window.history.forward(1);</script>
        <script type="text/javascript" src="example.js"></script>
        <link rel='stylesheet' type='text/css' href='example.css'>
    </head>
    <body>
    <form name='control' action='http://example.com/example/example?action=example' method='post'>
    
    <table class='top' style="height:'auto'; align:left; ">
    <tr><td align=left><a href="javascript:submitSearch('returnToSearch');">Back</a></td></tr>
    </table>
    
    <table class='page' align=left style="height:550; width:700;">
    <tr valign=top><td>
    
    <table style="height:'auto';">
        <span class='header'>
            <tr>
                <td colspan='2'><a href='http://example.com/example/example?abc=Home'> <img src='../example/theme/example.gif'  width='54'  height='25' border='0'>&nbsp; Home</a></td>
            </tr>
        </span>
    </table>
    
    <span class='middle'>
    <table class='right' style="height:'auto';">
    
    <tr><td colspan=5><font size=2><b>Example</b></font></td></tr><tr><td colspan=5><b>Example:&nbsp;</b>0000</td></tr><tr><td colspan=5><b>Example:&nbsp;</b>EXAMPLE</td></tr><tr><td colspan=5><b>EXAMPLE:&nbsp;</b>EXAMPLE</td></tr><tr><td align=center><b><u>Example</b></u></td><td align=center><b><u>Example</b></u></td><td align=center><b><u>Example</b></u></td><td align=center><b><u>Example</b></u></td><td align=center><b><u>Example abc <br>Example</b></u></td></tr><tr><td align=center><font size='3pt'></font></td><td align=center><a href='http://example.com/example/example?action=example&example=10101010&Example=5555'>555555</a></td><td align=center>10-10-10</td>
    </table>
    
    </span>
    
    </form>
    </td>
    <td><span class='right'> </span></td>
    </tr></table>
    </body>
    </html>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)