0

Here my code:

var loginButton = driver.FindElement(By.XPath("//*[@id="login - view"]/form/div[3]/button"));

I saw already this post: Find texts that contains quotation marks by xpath in Selenium

but it doesn't help me

the quotation marks are The problem

F1nn-T
  • 67
  • 8

3 Answers3

1

Try this use single quote to put id value in a string.

var loginButton = driver.FindElement(By.XPath("//*[@id='login - view']/form/div[3]/button"));
KunduK
  • 32,888
  • 5
  • 17
  • 41
0

Is the id property value correct? It has some spaces before and after "-"

fgiuliani
  • 390
  • 1
  • 3
  • 12
0

based on what you added here:

<button type="submit" aria-label="Login button" class="btn btn-large p-x-2 btn-inverse" disabled="">Log In</button>

This disabled attribute is causing issues because it makes the element, you guessed it, disabled! see - https://www.w3schools.com/tags/att_disabled.asp

If you remove that so it looks like this:

<button type="submit" aria-label="Login button" class="btn btn-large p-x-2 btn-inverse">Log In</button>

then you could use the below and it will work fine.

//button[text()='Log In']

Is there another login button that is not disabled?

Dazed
  • 1,527
  • 1
  • 13
  • 25