你可以从其他职位和评论中看到,你可能需要在你自己的网页上做一些试验,以确定哪一种方法能最快地找到你的内容。 我确实发现的一件事是,仅仅寻找后代人肯定会加快大页的步伐,因此,我们常常会找到一个集装箱元素,例如干iv,然后找到其后代:
IWebElement myDiv = myWebDriver.FindElement(By.ID("divId"));
IWebElement descendant = myDiv.FindElement(By.ID("descendantId"));
关于您是否能够就不同语言和市场作出一些假设,是你们能够做到的。 语言类型不同。 必须测试其中每一种语文,但不一定是这些语文中的每一种语文。 如果你支持的话,你将想测试含有不同特性的语文。
With that said, I think there is an important question that is not being asked, and that is... What are you getting out of running your automated tests on multiple languages? Does changing the language ever cause issues with functionality? Certain tests for date formats, etc are useful and can be automated, but if the only difference is the language, then unless you can test that the strings are translated correctly and are correct in context (which you can t unless you speak all of those languages fluently and want to maintain a massive list of strings in various languages) then it doesn t actually buy you much. I would suggest running a small subset of your automated tests in different languages and reduce the number of those different languages down to a handful based on their character sets and/or formatting differences. The biggest concerns that you have with different languages are layout issues where long strings can cause elements to grow larger than expected and cause problems. Most of these layout issues won t be caught by your automation anyways unless you have an extremely mature (and probably not cost effective) automation model that checks for page layout. You are better off getting a Pseudo-loc build that automatically enlarges strings and ensures that you are actually translating all of your text and doing one manual test pass against that pseudo loc build.
关于以多种语文核实案文的效率的相关员额和答案见:https://sqa.stack Exchange.com/questions/1949/do-you-verification-of-text-in-your-a auto-tests/1958#1958#。