嗨,我对这个间歇性问题感到非常沮丧,试图在文件资源管理器窗口中输入文件路径 - 它可以工作几个小时,然后继续删除第一步的键 (W:),然后发送路径的其余部分很好。我已经尝试过等待,但无论哪种方式都没有什么不同,它似乎没有选择何时想要重新开始工作。代码如下 - 有人对可能导致和/或解决此问题的原因有任何建议吗?
命名空间 PapercloudElite { 公共部分类 FileExplorer {
public static void EnterDirectoryPathField(string dirPath1, string dirPath2, string dirPath3)
{
Actions actions = new Actions(_driver);
actions.SendKeys(Keys.Delete);
actions.SendKeys(dirPath1);
actions.SendKeys(Keys.Alt + Keys.NumberPad9 + Keys.NumberPad2 + Keys.Alt);
actions.SendKeys(dirPath2);
actions.SendKeys(Keys.Alt + Keys.NumberPad9 + Keys.NumberPad2 + Keys.Alt);
actions.SendKeys(dirPath3).SendKeys(Keys.Enter).Build().Perform();
Thread.Sleep(2000);
}
The test step affected is as below:
**FileExplorer.EnterDirectoryPathField("W:", "AutomationTestDocuments", "GeneralDocs");**