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

  1. syntyax error on token "x", delete token
  2. chrome cannot resolved variable
  3. syntax error on token "" content="", (expected
  4. ie cannot resolved variable
  5. edge cannot resolved variable
  6. syntax error on token "">"",)expected
  7. 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?

enter image description here

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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -