Showing results for 
Search instead for 
Did you mean: 

Setting the checked property does not get saved




I'm trying to automate a page which has a checkbox without proper locators. So, using executeJavascript to work on it. I'm trying to check/uncheck the checkbox using two different ways:

  1. executeJavaScript("arguments[0].click();",$(By.cssSelector("[id*='is-district-admin-check']")));

  2. executeJavaScript("arguments[0].checked="+value+";",$(By.cssSelector("[id*='is-district-admin-check']")));

    (value - true/false)

The issue is - when I have tried to save, 1st works. 2nd does NOT work - means it is not saved though the checked property is changed correctly.

Can anyone please give me some idea on this?


Thank You

Honey Asin