Selenium webdriver script to enter an url to an element and press enter key -
this element present in contact form page uploading url need enter url of image , press enter
the code used me is...with code iam able enter text element enter key not pressed
driver.findelement(by.xpath("//*[@id='uploading-url']/input")).sendkeys("http://www.mytabletbooksqa.com/productimages/test1.gif"); webelement dropdownlists = driver.findelement(by.xpath("//*[@id='uploading-url']/input")); actions builder=new actions(driver); builder.clickandhold(dropdownlists).sendkeys(dropdownlists, keys.enter).release().build(); builder.perform();
the html code element
<div id="uploading-url"> <p class="reduce-space"><img alt="web_image" src="/images/content/duelr/web.png"></p> <input placeholder="enter urls upload web" type="text"></div>
please guide me on possibly going wrong here. thank time.
following code can help:
webelement dropdownlists = driver.findelement(by.xpath("//*[@id='uploading-url']/input")); dropdownlists.sendkeys("http://www.mytabletbooksqa.com/productimages/test1.gif"); robot robot = new robot(); robot.keypress(keyevent.vk_enter); robot.keyrelease(keyevent.vk_enter);
lemme know if works you!
Comments
Post a Comment