• <bdo id='frI1d'></bdo><ul id='frI1d'></ul>
  • <tfoot id='frI1d'></tfoot>

    <i id='frI1d'><tr id='frI1d'><dt id='frI1d'><q id='frI1d'><span id='frI1d'><b id='frI1d'><form id='frI1d'><ins id='frI1d'></ins><ul id='frI1d'></ul><sub id='frI1d'></sub></form><legend id='frI1d'></legend><bdo id='frI1d'><pre id='frI1d'><center id='frI1d'></center></pre></bdo></b><th id='frI1d'></th></span></q></dt></tr></i><div id='frI1d'><tfoot id='frI1d'></tfoot><dl id='frI1d'><fieldset id='frI1d'></fieldset></dl></div>

      <small id='frI1d'></small><noframes id='frI1d'>

      <legend id='frI1d'><style id='frI1d'><dir id='frI1d'><q id='frI1d'></q></dir></style></legend>
      1. 如何通过Selenium和C#保存通过SendKeys()方法发送的字符序列

        How to preserve the character sequence sent through SendKeys() method through Selenium and C#(如何通过Selenium和C#保存通过SendKeys()方法发送的字符序列)
      2. <tfoot id='Zrefq'></tfoot>
            <legend id='Zrefq'><style id='Zrefq'><dir id='Zrefq'><q id='Zrefq'></q></dir></style></legend>
              <bdo id='Zrefq'></bdo><ul id='Zrefq'></ul>

                  <tbody id='Zrefq'></tbody>

                  <small id='Zrefq'></small><noframes id='Zrefq'>

                  <i id='Zrefq'><tr id='Zrefq'><dt id='Zrefq'><q id='Zrefq'><span id='Zrefq'><b id='Zrefq'><form id='Zrefq'><ins id='Zrefq'></ins><ul id='Zrefq'></ul><sub id='Zrefq'></sub></form><legend id='Zrefq'></legend><bdo id='Zrefq'><pre id='Zrefq'><center id='Zrefq'></center></pre></bdo></b><th id='Zrefq'></th></span></q></dt></tr></i><div id='Zrefq'><tfoot id='Zrefq'></tfoot><dl id='Zrefq'><fieldset id='Zrefq'></fieldset></dl></div>

                  本文介绍了如何通过Selenium和C#保存通过SendKeys()方法发送的字符序列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  Selenium c# 在我的测试网站的文本框中输入数据时,光标位置设置为中间,输入的数据类似于例如3421 而不是 1234 的正确顺序.

                  Selenium c# when entering data in a Textbox for My Test Website the the cursor position is set to the Middle and the data entered is like for e.g. 3421 instead of the correct Order of 1234.

                  任何人都可以提出一个如何处理这个问题的好方法吗?

                  Can anyone suggest a good way as to how to handle this?

                  我曾尝试使用按 HOME 键按钮,但没有成功.

                  I have tried to Use pressing the HOME key button but it did not work.

                  推荐答案

                  通过发送的字符序列的顺序不持久性背后的实际问题很难预测SendKeys() 方法在没有相关 HTML 的情况下.

                  It would be tough to predict the actual issue behind the non perseverance of the sequential order of the character sequence sent through SendKeys() method in absence of the relevant HTML.

                  但是,如果 AUT(被测应用程序) 是 JavaScript, Angular 或 ReactJS基于 ,根据 最佳实践,您需要诱导 WebDriverWait 以使所需的 元素可点击,然后您需要调用 Clear() 方法,最后调用 SendKeys() 方法如下:

                  However, in case the AUT (Application Under Test) is JavaScript, Angular or ReactJS based, as per best practices you need to induce WebDriverWait for the desired element to be clickable, then you need to invoke Clear() method and finally invoke SendKeys() method as follows:

                  • C#:

                  IWebElement textBoxElement = new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(ExpectedConditions.ElementToBeClickable(By.XPath("xpath_of_HOME_key_button")));
                  textBoxElement.Click();
                  textBoxElement.Clear();
                  textBoxElement.SendKeys("1234");
                  

                  这篇关于如何通过Selenium和C#保存通过SendKeys()方法发送的字符序列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  C# namespace alias - what#39;s the point?(C# 命名空间别名 - 有什么意义?)
                  Using Xpath With Default Namespace in C#(在 C# 中使用具有默认命名空间的 Xpath)
                  Generating an EDMX from a DB2 Database(从 DB2 数据库生成 EDMX)
                  IBM .NET Data Provider Connection String issue with Library List(库列表的 IBM .NET 数据提供程序连接字符串问题)
                  .NET DB2 OLEDB pre-requisites(.NET DB2 OLEDB 先决条件)
                  Referring to Code in IBM.Data.DB2 makes that Assembly Unavailable to the rest of my Solution(引用 IBM.Data.DB2 中的代码使该程序集对我的解决方案的其余部分不可用)

                    <tbody id='ekkhn'></tbody>
                • <legend id='ekkhn'><style id='ekkhn'><dir id='ekkhn'><q id='ekkhn'></q></dir></style></legend>

                      <small id='ekkhn'></small><noframes id='ekkhn'>

                      <tfoot id='ekkhn'></tfoot>
                    • <i id='ekkhn'><tr id='ekkhn'><dt id='ekkhn'><q id='ekkhn'><span id='ekkhn'><b id='ekkhn'><form id='ekkhn'><ins id='ekkhn'></ins><ul id='ekkhn'></ul><sub id='ekkhn'></sub></form><legend id='ekkhn'></legend><bdo id='ekkhn'><pre id='ekkhn'><center id='ekkhn'></center></pre></bdo></b><th id='ekkhn'></th></span></q></dt></tr></i><div id='ekkhn'><tfoot id='ekkhn'></tfoot><dl id='ekkhn'><fieldset id='ekkhn'></fieldset></dl></div>
                          • <bdo id='ekkhn'></bdo><ul id='ekkhn'></ul>