C# 硒元素之间伪找不到

C# 硒元素之间伪找不到,c#,selenium,selenium-webdriver,webdriver,automated-tests,C#,Selenium,Selenium Webdriver,Webdriver,Automated Tests,一个页面包含以下HTMl <div class="call-to-action call-to-action--final"> <input type="submit" name="complete" value="Complete order" class="btn btn--primary" data-submit-payment="true"> </div> 现在我想从selenium中找到这个输入,但找不到,代码是 [FindsBy(How

一个页面包含以下HTMl

<div class="call-to-action call-to-action--final">

  <input type="submit" name="complete" value="Complete order" class="btn btn--primary" data-submit-payment="true">
</div>
现在我想从selenium中找到这个输入,但找不到,代码是

 [FindsBy(How = How.XPath, Using = "//div[contains(@class,'call-to-action--final')]//input")]
        public IWebElement CompleteBtn { get; set; }
也试过

 [FindsBy(How = How.XPath, Using = "//div[contains(@class,'call-to-action--final')]/input")]
        public IWebElement CompleteBtn { get; set; }


 [FindsBy(How = How.XPath, Using = "//div[contains(@class,'call-to-action--final')]/input[(@value='Complete order')]")]
        public IWebElement CompleteBtn { get; set; }
什么都不起作用,我认为它的伪元素制造了问题,但无法摆脱它

非常感谢您的帮助

谢谢你试过了吗

[FindsBy(How = How.CssSelector, Using = "input[name='complete']")]


这是元素的复制问题,我使用更复杂的选择器解决了它。如果这回答了您的问题,请接受它作为答案。如果你发现了一个不同的答案,请把它作为一个答案张贴出来,并接受它为将来的人。谢谢!这并不能肯定地回答我的问题,我的问题是目标html设计。这需要一些调整来检查元素,我不相信这是可以复制的。
[FindsBy(How = How.CssSelector, Using = "input[name='complete']")]
[FindsBy(How = How.CssSelector, Using = "input[value='Complete order']")]