使用Selenium C#点击Google Form Quiz ViewScore按钮。

问题描述 投票:0回答:1

我试着用Selenium点击最后这个按钮来查看分数,但它不工作。我试过使用CSSselector。有什么好办法吗?

![1]: https:/i.stack.imgur.comNZ90V.png。

try
        {
            var reee = driver.FindElement(By.CssSelector("body > div.freebirdFormviewerViewFormContentWrapper > div:nth-child(2) > div.freebirdFormviewerViewFormCard.exportFormCard > div > div.freebirdFormviewerViewResponseLinksContainer > div > a > span"));
            Actions actions = new Actions(driver);
            actions.MoveToElement(reee);
            Thread.Sleep(2000);
            actions.Click();
            actions.Build().Perform();
        }
        catch
        {
            Console.WriteLine("well not working");
        }

(提交按钮也能用)(对我来说很简单,我15岁)

c# selenium-webdriver selenium-firefoxdriver
1个回答
0
投票

看看这样使用链接的文本是否有效?

<span class="appsMaterialWizButtonPaperbuttonLabel quantumWizButtonPaperbuttonLabel exportLabel">Преглед на оценката</span>


driver.FindElement(By.Xpath("//span[contains(text(), 'Преглед на оценката')]")).Click();
© www.soinside.com 2019 - 2024. All rights reserved.