java - Assert part of page source not working -
i'm trying confirm bit of code in page source. not accept section i'm trying assert. i'm using:
asserttrue(driver.getpagesource().contains("<meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1">"));
i'm getting errors on section after .contains(.
multiple markers @ line
- syntyax error on token "x", delete token
- chrome cannot resolved variable
- syntax error on token "" content="", (expected
- ie cannot resolved variable
- edge cannot resolved variable
- syntax error on token "">"",)expected
- ua cannot resolved variable
i think section of code or text i'm trying assert being read eclipse part of code , not text i'm trying assert. there workaround this?
also, perhaps question, i'm trying assert section find out if compatibility icon showing in ie10. want not show is. due bit of code on current page being replaced code i'm trying assort using statement above. there way assert if icon present or not?
using eclipe selenium webdriver , java
this because of double quote in middle of string. use escape character before double quote :
asserttrue(driver.getpagesource().contains("<meta http-equiv=\"x-ua-compatible\" content=\"ie=edge,chrome=1\">"));
Comments
Post a Comment