Selenium Webdriver (Java) , Need to send "Space" keypress to the website as whole -


my problem follows.

i attempting automate part of test suite website work in, , while of went well, i'm @ point developers added lightbox confirm next action.

using firebug found out xpath use click button need proceed, sadly isn't working.

after manual attempts, figured pressing "space" key, can proceed.

the problem sort of try using "driver.findelement" xpath, or link text, fails "no such element" error in console.

so i'm trying send keypress of space , without using find element.

to clear, want emulate pressing space without clicking or selecting beforehand.

i tried driver.keyboard... "keyboard" isn't recognized, i'm @ loss of how send keypress without using driver.findelement.

the piece of code giving me problems is:

driver.findelement(by.xpath("//div[4]/div[3]/div/button")).click(); 

any appreciated.

thank , have great day!

if receive nosuchelementexception, know element there, seems element loaded dom later (with ajax?), page loaded. in case should use implicit or explicit wait wait until element present, or element visible, etc...

if still doesn't work, , want try space key thing, can perform on element, example on <body> tag:

webelement body = driver.findelement(by.tagname("body")); body.sendkeys(keys.space); 

hope helps.


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -