[英]how to click on 'new <div>' which newly generates after clicking on a button? in C# selenium
before i clicking the button, the html code for the page is below 在我单击按钮之前,页面的html代码在下面
<div id="layerContainer"> </div>
but after clicking a button, than the code appears like picture here 但是单击按钮后,代码显示为此处的图片
I tried to find the new button, but always "unable to find element ~@" ] 我试图找到新按钮,但始终“无法找到元素〜@”]
wait.Until(ExpectedConditions.ElementExists(By.XPath("//*[@id='layerContainer']/div/section/div/div[2]/form/article/footer/div/button")));
IWebElement submit2 = this.driver.FindElement(By.XPath("//*[@id='layerContainer']/div/section/div/div[2]/form/article/footer/div/button"));
submit2.Click();
my purpose is to find out the newly generated button and click on it, but it fails to find out the new button all the time, is there any way to solve it? 我的目的是找出新生成的按钮并单击它,但是它始终无法找到新按钮,有什么办法可以解决?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.