java - Assert Specify Text Present or not -


i need verify whether specific banner present or not , tried storing src value of image , comparing , not able ,

also related text change banner name uploaded same , need assert store value .

here code

public void testssssss() throws exception {     driver.get(baseurl + "/?country=us");     string storze = driver.findelement(by.cssselector("img[alt=\"website banner\"]")).getattribute("outerhtml");     system.out.println(storze);     assertequals(storze, storze.contains("bannerbanner-2015-summersplashout_affbanners-664x272-881.gif"));   } 

value store in storze :

 img src="/wp-content/uploads/2015/07/bannername-2015-summersplashout_affbanners-664x272-88.gif" alt="bannerbanner" height="289" width="677" 

i need check text "bannername-2015-summersplashout_affbanners-664x272-88.gif".

not able automate.code appreciated .

from question come know want assert storz value banner name, if case should try :

boolean flag = false;     if (storz             .contains("bannerbanner-2015-summersplashout_affbanners-664x272-881.gif")) {         flag = true;     }      assert.assertequals(flag, true); 

and noticed asserting boolean value string.


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -