Java WebDriver Copy text Issue -


good afternoon,

so trying copy text field can paste somewhere else in test.

public static void validatetestcasecreated(){     driver.findelement(by.xpath("//*[@id='mainform:testtitle']")).click();     action builder;     actions copy = new actions(driver);     copy.sendkeys(keys.control + "a");     copy.sendkeys(keys.control + "c");     builder = copy.build();     builder.perform(); 

the problem when reaches line 6 sends c, ignores control. end result not copying text highlighting text entering c.

you copy value text field variable , store use later.

pull page using code along attribute method.

string valueinfield = driver.findelement(by.xpath("//*[@id='mainform:testtitle']")).getattribute("value"); 

that grab text field , put variable later use.

i'm not sure if doing trying do, seeing trying crtl+c, method how grab text using webdriver.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -