Davi Luquini
Davi Luquini

Reputation: 11

Selenium runs locally but not in github Actions

Code:

 [TestFixture]
    public class CETestsActionDev
    {
        private IWebDriver driver;

        private readonly string environment = "dev";

        private static int _randomNumber;

        [SetUp]
        public void Setup()
        {
            //They re commented because if not, code in gbActions doesnt find even "userName"
            //ChromeOptions options = new();
            //options.AddArgument("start-maximized");
            //options.AddArgument("--disable-gpu");
            //options.AddArgument("--headless");

            driver = new ChromeDriver();    
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
        }
   [Test]
   public void SuccessCloudExpertProfile()
   {
    Thread.Sleep(TimeSpan.FromSeconds(5));
    driver.Navigate().GoToUrl("https:comapnyExemplo.com");
    Thread.Sleep(TimeSpan.FromSeconds(10));
    string emailDev = "[email protected]";

    driver.FindElement(By.XPath("//*[@id='userName']")).SendKeys(emailDev);
    driver.FindElement(By.XPath("//*[@id='password']")).SendKeys("testCloud2Gether");

    Thread.Sleep(TimeSpan.FromSeconds(1));

    driver.FindElement(By.XPath("//*[@id='buttonForm']")).Click();

    Thread.Sleep(TimeSpan.FromSeconds(10));

     AddPublicNameAndAboutField(driver);
   //First xpath from this method is "name"
 AddLanguages(driver);
 RemoveLanguages(driver);
 CorrectAdress(driver);
 }

GitHub Actions Yaml: Test_Project_Path: C2GSeleniumTeste.csproj

steps:

I want to run selenium code in GithubActions but im not having success

Upvotes: 0

Views: 57

Answers (1)

Davi Luquini
Davi Luquini

Reputation: 11

When the tests were running in GitHub Actions, the reCAPTCHA was activated.

Upvotes: 1

Related Questions