java - Unable to locate element: {"method":"id","selector":"sysPublishDateDate"} -


i tried call textbox. getting following error: unable locate element: {"method":"id","selector":"syspublishdatedate"}.

here come attaching code this:

        try{         webelement title = driver.findelement(by.xpath("//div[@id='widget_title']//input[@id='title']"));         title.sendkeys("automation");         webelement browse = driver.findelement(by.xpath("//div[@id='listingthumbnail']//span[@id='dijit_form_button_14']"));         browse.click();         driver.manage().timeouts().implicitlywait(150,timeunit.seconds);             try{             list<webelement> sidemenu = driver.findelements(by.xpath("//*[@id='dijit_layout_contentpane_6']"));             for(webelement drop:sidemenu){                 system.out.println(drop.gettext());             }          }catch(exception e){          }          webelement file = driver.findelement(by.xpath("//*[@id='dijit_layout_contentpane_6']//div[5]/div[@class='dijittreerow']/img"));         file.click();         driver.manage().timeouts().implicitlywait(150,timeunit.seconds);             webelement thumbnails = driver.findelement(by.xpath("//*[@id='dotcms_dijit_filebrowserdialog_2-tree-treenode-3bc7e461-117f-4f0c-96fe-8edb24ec6cde']/div[1]"));         thumbnails.click();         driver.manage().timeouts().implicitlywait(150,timeunit.seconds);         webelement  image = driver.findelement(by.xpath("//*[@id='file-5a88cc64-dd56-4d40-8778-8df7fb2f233d0']/a/img"));         image.click();         driver.manage().timeouts().implicitlywait(150, timeunit.seconds);         driver.switchto().defaultcontent();         webdriver myframe= driver.switchto().frame(driver.findelements(by.tagname("iframe")).get(0));         webelement summary = myframe.findelement(by.xpath("//*[@id='tinymce']"));         summary.sendkeys("testing dotcms");                  //webelement story = driver.findelement(by.xpath("//table[@id='story_tbl']//td[@class='mceiframecontainer mcefirst mcelast']/iframe"));          try{             driver.switchto().defaultcontent();             webdriver myframe = driver.switchto().frame(driver.findelement(by.xpath("//*[@id='story_ifr']")));             webelement story = myframe.findelement(by.xpath("//*[@id='tinymce']"));             story.sendkeys("testing dotcms automation");            }catch (exception e){             system.out.println("iframe not found");         }          }catch (exception e){      }      driver.manage().timeouts().implicitlywait(150, timeunit.seconds);     webelement dateselection = driver.findelement(by.id("syspublishdatedate"));     dateselection.clear();     dateselection.sendkeys("8/7/2013",keys.enter); 

i getting error in line. webelement dateselection = driver.findelement(by.id("syspublishdatedate")); dateselection.clear(); dateselection.sendkeys("8/7/2013",keys.enter);

in code enters values. tried identify frames , iframes nothing blocking there . stuck finding solution.

try this

webdriverwait wait = new webdriverwait(webdriver, timeoutinseconds); wait.until(expectedconditions.visibilityofelementlocated(by.id("syspublishdatedate"))); 

or

wait.until(expectedconditions.elementtobeclickable(by.id("syspublishdatedate"))); 

and use

webelement dateselection = driver.findelement(by.id("syspublishdatedate")); dateselection.clear(); dateselection.sendkeys("8/7/2013",keys.enter); 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -