Search code examples
c#seleniumbuttonclick

C# Selenium click Button specifig Page


i looked around and found until now no solution with useing searchengines! I am useing C# and Selenium for automatism some Webpages. Now i am struggling with one Login-Button.

The Page is called: https://eatradingacademy.com/profile/

Typing in Username and Password will be no problem. But for the Login-Button I am not able to click the Button "Login".

I did not find an ID or something else.

Can someone here help me out?

What lines of Code are needed to click this "Login" Button on page "https://eatradingacademy.com/profile/"?

If you need more information from my side ... Just tell me! Thanks all of you reading this ...


Solution

  • You can use xpath to locate this element. In your case this should do the job:

    driver.FindElement(By.XPath("//button[text()='Login']")).Click();
    

    For future reference on working with xpaths, you can use this cheatsheet: https://devhints.io/xpath