Guest User

Untitled

a guest
Sep 28th, 2020
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. static void AcceptTos()
  2. {
  3. /*
  4. FirefoxOptions options = new FirefoxOptions();
  5. options.AddArgument("-headless");
  6.  
  7. var driverService = FirefoxDriverService.CreateDefaultService();
  8. driverService.HideCommandPromptWindow = true;
  9. */
  10. IWebDriver web = new FirefoxDriver();
  11.  
  12.  
  13. web.Navigate().GoToUrl("https://wykop.pl");
  14. WebDriverWait wait = new WebDriverWait(web, TimeSpan.FromSeconds(10));
  15. wait.Until(ExpectedConditions.ElementToBeClickable(By.ClassName("MuiGrid-root")));
  16. IWebElement element = web.FindElement(By.ClassName("MuiGrid-root"));
  17. Actions actions = new Actions(web);
  18. actions.MoveToElement(element).Click().Perform();
  19. }
  20.  
Add Comment
Please, Sign In to add comment