Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
135
rated 0 times [  141] [ 6]  / answers: 1 / hits: 33178  / 10 Years ago, fri, november 21, 2014, 12:00:00

I need to call a JavaScript function from Selenium WebDriver in Firefox.
I use this command in Firebug's Command Editor to invoke a file upload application after logged into my website:



infoPanel.applicationManager.changeApp('FileUploader', {action: 'new'})


Is there a way to execute this from Selenium?


More From » selenium

 Answers
11
WebDriver driver = new AnyDriverYouWant();

if (driver instanceof JavascriptExecutor)

{

((JavascriptExecutor)driver).executeScript(yourScript(););

}

[#68745] Tuesday, November 18, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
aileenreynap

Total Points: 140
Total Questions: 106
Total Answers: 99

Location: Andorra
Member since Sun, Oct 18, 2020
4 Years ago
;