I have done everything which is provided in this link - https://spage.fi/electron . Firstly I downloaded the correct version of Chromedriver for the corresponding Electron latest stable release and for the ubuntu-16.04 from this link - https://github.com/electron/electron/releases . And I started the chromedriver from the terminal
It Showed the message like this in terminal
Starting ChromeDriver 2.30 (7accc8730b0f99b5e7c0702ea89d1fa7c17bfe33) on port 9515 Only local connections are allowed.
Then I created a python file, vars.py with following content:
binary_location = {"chromeOptions": {"binary": "path/to/electron/application"}}
And finally created Robot Framework test suite, like this:
*** Settings ***
Library Selenium2Library run_on_failure=Log Source
Variables vars.py
*** Test Cases ***
Foo
Create Webdriver Remote desired_capabilities=${binary_location} command_executor=http://localhost:9515
Sleep 15s
Click Element password
#password is the id of the textfield
Input Text password 1234
[Teardown] Close All Browsers
When I run the test in the Ride IDE, The test suite runs and it opens the Electron app and it displays the front page of the app. But after the 15s sleep the log is showing as Clicking element password and it continues to run in that state while nothing happens in the electron app
I don't know why its not running the keywords while it runs perfectly in the browser corresponding to the electron app
I changed the vars.py again as shown below
binary_location = {"browserName": "chrome", "chromeOptions": {"binary": "path/to/electron/application"}}
I checked this link from the electron docs - https://github.com/electron/electron/blob/master/docs/tutorial/using-selenium-and-webdriver.md
Still I'm not getting the reason why it's not working inside the electron app. Please help me to run the keywords to test the electron app. Is it even possible to test the electron app using Robot Framework??
Aucun commentaire:
Enregistrer un commentaire