I did automation of Oracle form Java Applet using python pyjab module, i need the execution to be worked without opening the rdp

Himasai Pentakoti 0 Reputation points
2023-06-21T05:55:12.6566667+00:00

I did the Oracle form Java Applet automation using python pyjab module, i am executing that script in rdp, I want execution should happen without opening the rdp, if i start the execution without opening the rdp, the execution failing, for entering a value i am providing simulate = True. For this one to work the screen should focused , how should achieve this

Windows for business Windows Client for IT Pros User experience Remote desktop services and terminal services
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,746 Reputation points
    2023-06-21T11:59:50.1833333+00:00

    Hello Himasai,

    Thank you for your question and for reaching out with your question today.

    To achieve automation without opening the RDP (Remote Desktop Protocol) window and ensure that the screen is focused, you can try using a headless browser automation tool like Selenium WebDriver with ChromeDriver.

    Here's an example of how you can modify your Python script to achieve this:

    1. Install the required libraries:
      
         pip install selenium
      
      
    2. Download the ChromeDriver executable that matches your Chrome browser version and place it in a directory accessible by your Python script.
    3. Modify your script to use Selenium WebDriver with ChromeDriver:
      
         from selenium import webdriver
      
         from selenium.webdriver.chrome.options import Options
      
         # Configure Chrome options for headless mode
      
         chrome_options = Options()
      
         chrome_options.add_argument("--headless")  # Run Chrome in headless mode
      
         # Set the path to the ChromeDriver executable
      
         chromedriver_path = '/path/to/chromedriver'  # Replace with your actual path
      
         # Create a new ChromeDriver instance with the configured options
      
         driver = webdriver.Chrome(executable_path=chromedriver_path, options=chrome_options)
      
         # Set the window size to ensure the screen is focused
      
         driver.set_window_size(1920, 1080)  # Adjust the size as needed
      
         # Your automation code here...
      
      
      Replace /path/to/chromedriver with the actual path to the ChromeDriver executable on your system.
    4. Modify your automation code to use the driver instance from Selenium WebDriver. You can interact with the Oracle form Java applet using the WebDriver's methods like find_element_by_* and send_keys or other relevant methods based on your specific requirements. For example:
      
         # Example code to interact with a text field
      
         text_field = driver.find_element_by_id('my_text_field')
      
         text_field.send_keys('Value to enter')
      
      

    By using Selenium WebDriver with ChromeDriver in headless mode, your script will be able to execute without opening the RDP window, and the screen will be focused, allowing you to interact with the Oracle form Java applet successfully.

    I used AI provided by ChatGPT to formulate part of this response. I have verified that the information is accurate before sharing it with you.

    If the reply was helpful, please don’t forget to upvote or accept as answer.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.