c# - How to convert WebElement to string? -


here code i'm trying . i'm using c# basic if else statement compare.

iwebelement findtitle = driver.findelement(by.classname("heading3"));  if (title = findtitle.text) {      console.writeline("test pass"); } else {      console.writeline("test fail"); } 

you assigning value title, not comparing it. use == compare

if (title == findtitle.text) 

if want compare using ignore case use

if (findtitle.text.indexof(title, stringcomparison.ordinalignorecase) != -1) 

this check if findtitle text contains text of title.


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -