Error as the previous one for sikuli upload

0 votes
public class FileUpload {

public static void main(String[] args) throws InterruptedException, FindFailed {

       //Firefox

System.setProperty("webdriver.gecko.driver","C:\\Drivers\\geckodriver-v0.28.0-win64\\geckodriver.exe");

WebDriver driver =new  FirefoxDriver();

 // System.setProperty("webdriver.chrome.driver","C:\\Drivers\\chromedriver_win32\\chromedriver.exe");

 // WebDriver driver=new ChromeDriver();

driver.get("https://opensource-demo.orangehrmlive.com");

//Login

driver.findElement(By.id("txtUsername")).sendKeys("admin");

driver.findElement(By.id("txtPassword")).sendKeys("admin123");

driver.findElement(By.id("btnLogin")).click();

Thread.sleep(3000);

driver.findElement(By.xpath("//*[@id=\"menu_pim_viewPimModule\"]")).click();  //PIM

driver.findElement(By.xpath("//*[@id=\"menu_pim_addEmployee\"]")).click();    //AddEmployee

  //Direct

 // driver.findElement(By.id("photofile")).sendKeys("C:\\SeleniumPractice\\Sikulifiles\\profilepic.jpg");

  // driver.findElement(By.id("photofile")).click();

WebElement browse=driver.findElement(By.id("photofile"));

JavascriptExecutor js=(JavascriptExecutor)driver;

js.executeScript("arguments[0].click();",browse);

//Sikuli code starts here

Pattern fileInputTextBox=new Pattern("C:\\SeleniumPractice\\Sikulifiles\\filetxtbox.png");

Pattern openButton=new Pattern("C:\\SeleniumPractice\\Sikulifiles\\openbtn.png");

      Screen s=new Screen();

       

      s.wait(fileInputTextBox,3);

  s.type(fileInputTextBox,"C:\\SeleniumPractice\\Sikulifiles\\profilepic.jpg");

  s.click(openButton);

  

}

}

-----------------------console window--------------------------

1607914215045 geckodriver INFO Listening on 127.0.0.1:30146

1607914215733 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "-foreground" "-no-remote" "-profile" "C:\\Users\\mailf\\AppData\\Local\\Temp\\rust_mozprofileCXKshL"

Can't find symbol 'eglSwapBuffersWithDamageEXT'.

Can't find symbol 'eglSetDamageRegionKHR'.

JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory.

console.warn: SearchSettings: "get: No settings file exists, new profile?" (new Error("", "(unknown module)"))

1607914217827 Marionette INFO Listening on port 60225

1607914217878 Marionette WARN TLS certificate errors will be ignored for this session

Dec 13, 2020 8:50:17 PM org.openqa.selenium.remote.ProtocolHandshake createSession

INFO: Detected dialect: W3C

Exception in thread "main" FindFailed: C:/SeleniumPractice/Sikulifiles/filetxtbox.png: (979x38) in S(0)[0,0 1504x1003] E:Y, T:3.0

  Line 2277, in file Region.java

at org.sikuli.script.Region.wait(Region.java:2277)

at day20.FileUpload.main(FileUpload.java:56)
Dec 14, 2020 in Selenium by faha
• 380 points
1,791 views

Hey, @Faha,

Please post your error logs here so that we can resolve your query ASAP?

Ok Let me check in detail for both of the scripts. Will soon get back.
Can't find symbol 'eglSwapBuffersWithDamageEXT'.

Can't find symbol 'eglSetDamageRegionKHR'.

JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory.

console.warn: SearchSettings: "get: No settings file exists, new profile?" (new Error("", "(unknown module)"))

xception in thread "main" FindFailed: C:/SeleniumPractice/Sikulifiles/filetxtbox.png: (979x38) in S(0)[0,0 1504x1003] E:Y, T:3.0

  Line 2277, in file Region.java

at org.sikuli.script.Region.wait(Region.java:2277)

at day20.FileUpload.main(FileUpload.java:56)

Hey @faha,

Directly use sendKeys to upload files. No need to use sikuli and all.

@ Nikita..

I know but it was taught that sikuli is used for windows based applications. Sendkeys method which u mentioned comes from selenium which is only web-based application. Have u tried the script posted thru eclipse. It's running 90% fine but in the end for uploading files thru (location and file name)...it cant go ahead. Please acknowledge further.

Yes, @Faha,

I got your error message. Just try the sendKeys method instead of sikuli.

1 answer to this question.

0 votes

@Faha,

This error message...

JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory.

implies that there was a JavaScript error while GeckoDriver initiated/spawned a new Browsing Context i.e. Firefox browsing session.


When Selenium driven GeckoDriver initiates a Firefox browsing session there can be a couple of JavaScript-related WARNINGS and ERRORS as a part of TRACE level logs during initialization. You can safely ignore those initialization errors till GeckoDriver is successfully able to initiate a Firefox Browsing session.

answered Dec 15, 2020 by Gitika
• 65,770 points

Related Questions In Selenium

+1 vote
2 answers
0 votes
0 answers
0 votes
1 answer
0 votes
1 answer

Error with Selenium File Upload

In your code, you have used "WebElement" ...READ MORE

answered Mar 30, 2018 in Selenium by nsv999
• 5,500 points
6,227 views
0 votes
1 answer

dBase for my website always gives me this error “Invalid syntax”

Seems like you are missing a close ...READ MORE

answered Mar 30, 2018 in Selenium by nsv999
• 5,500 points
1,197 views
0 votes
1 answer

Using gettext() method for the specific element using Selenium WebDriver

Mistake is that u r printing the ...READ MORE

answered Apr 10, 2018 in Selenium by Vardy
• 2,360 points
28,721 views
0 votes
1 answer

Sikuli file upload, even after writing the correct script getting error. Any solution?

Hey, @Faha, This error message... JavaScript error: resource://gre/modules/XULStore.jsm, line ...READ MORE

answered Dec 15, 2020 in Selenium by Gitika
• 65,770 points
2,525 views
0 votes
1 answer

I need help for below question as i need to submit the project...

Hi, @priyanka, Regarding your query, there are multiple ...READ MORE

answered Nov 26, 2020 in Selenium by Gitika
• 65,770 points
1,173 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP