0

I need to identify two colours from an element when it is toggled on and toggled off; for example when its On its rgb(40, 170, 228) and when toggled Off rgb(101, 113, 151). I am using Iwebdriver, so limited with the methods that this brings to the table.

I have tried to not success string colour = IWebElement.GetCssValue("background-color"); from another question, however, due to GetCSSValue not being present then I get an error

iWebdriver Does Not Contain A Definition For GetCssValue

CalAtk
  • 45
  • 1
  • 10

1 Answers1

0

The following works - Add the following to your POM:

public IWebElement BranchToggleOn { get { return driver.FindElement(By.XPath("/html/body/div[1]/div/div/div/div[2]/div[2]/div/div/div/div/div/table/thead/tr/th[3]/div/label/span")); } }

Then in your test:

string attValue = HomePage.BranchToggleOn.GetCssValue("rgb 255, 255, 255");
CalAtk
  • 45
  • 1
  • 10