java - for loop in selenium doesn't work -
code:
try { //load file java workbook workbook=workbook.getworkbook(sourceforcustomergroup); //load sheet number (0 sheet 1) sheet sheetforgroups= workbook.getsheet(0); cell c1 = sheetforgroups.getcell(customercolumn, customerrow); string customergroupname = c1.getcontents(); (int = 0; i<sheetforgroups.getrows(); i++, customerrow++) { driver.findelement(by.id("tab3")).click(); driver.findelement(by.id("new")).click(); driver.findelement(by.id("groupname")).clear(); driver.findelement(by.id("groupname")).sendkeys(customergroupname); driver.findelement(by.id("save")).click(); customerrow = 1; customercolumn = 1; (int j = 0; j<sheetforgroups.getrows()-1; j++, customerrow++) { cell c2 = sheetforgroups.getcell(customercolumn, customerrow); string clientuserid = c2.getcontents(); driver.findelement(by.id("clientuserid1")).clear(); driver.findelement(by.id("clientuserid1")).sendkeys(clientuserid); driver.findelement(by.id("add")).click(); } //doesn't work here driver.findelement(by.id("actions")).click(); driver.findelement(by.id("save")).click(); } } the code doesn't seem run commands after second loop. have tried tracing manually , don't think i've made logical mistake (i hope stand corrected). what's wrong?
Comments
Post a Comment