简体   繁体   English

html“ ID”属性消失

[英]html 'ID' attribute disappears

I am currently trying to test a website using selenium and when I run the tests locally on my computer the tests will pass however when I run the tests on TeamCity the tests will fail because they can't find an element with the specified id. 我目前正在尝试使用硒测试网站,当我在计算机上本地运行测试时,测试将通过,但是当我在TeamCity上运行测试时,测试将失败,因为它们找不到具有指定ID的元素。

When the tests are ran they are testing the exact same HTML page, when they are running on my computer locally and I check the element for its ID attribute it will show that the ID is rad_button1 . 当运行测试时,他们正在测试完全相同的HTML页面,当它们在本地计算机上运行时,我检查该元素的ID属性,它将显示ID为rad_button1 However when the test is ran on TeamCity I look at the attributes for the same element and the ID attribute no longer has any ID. 但是,当在TeamCity上运行测试时,我查看了同一元素的属性,并且ID属性不再具有任何ID。

Has anyone encountered this issue before? 有人遇到过这个问题吗?

The problem here was that IE9 was running in compatibility mode by default which we didnt know. 这里的问题是,默认情况下,IE9在兼容模式下运行,我们不知道。 So on the developers machine it was running ie9 normally and on the remote machine it was running IE9 in compatibility mode and this is what was causing the IDs to disappear. 因此,在开发人员计算机上,它正常运行ie9,而在远程计算机上,它以兼容模式运行IE9,这就是导致ID消失的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM