0

I have a script list nearly 100 scripts to which I need to pass argument for each scripts and these arguments are different for each script.

The way I tried passing arguments for each script individually which is consuming a lot of time and manuval intervention. Can any one suggest me an easiest way to pass my inputs to these scripts.

code i have tried the below code for passing same values for all input boxes:

driver.find_element(By.XPATH, '//[@id="side-maincontainer-wrapper"]/div/div/div[2]/earms-suitehome/div/div/div/div/div[2]/div[2]/div1/earms-categorydetails/div/div/div[3]/div[2]/clr-datagrid/clr-dg-action-bar/button[3]').click() num_scripts=54 for i in range(0, (num_scripts - 1)): #time.sleep(20) driver.find_element(By.XPATH, '//[@id="side-maincontainer-wrapper"]/div/div/div[2]/earms-requestrunhome/earms-testbedselection/div/div/div/div/div[2]/div/div1/div/form/div/div/div/div/div/div/clr-datagrid/div/div/div/clr-dg-table-wrapper/div[2]/clr-dg-row1/div/clr-dg-cell[3]/input//div').send_keys( "--crft --crft-devices pireg-nyquist1-1 pireg-nyquist1-2 --btrace-devices uut --btrace --configuration /auto/arf1/vramiyen/pyats_crft/SELinux_plugin/config.yaml --selinux --selinux-devices uut --template /auto/bgl-xeinfra/pmotukan/template.input --platform /auto/arf1/vramiyen/pyats_crft/SELinux_plugin/platform.py")

image snippet

attached the picture below ,so i need to pass my args in that cmd line input box,and the arguments for each box are different

2
  • 1
    Can you share your code? How those scripts look like? How and where you store arguments? Commented Jul 11, 2022 at 12:12
  • added my code and required image snippets in my question Commented Jul 23, 2022 at 7:28

1 Answer 1

0

I have used this module before for parsing arguments:

https://docs.python.org/3/library/argparse.html

The argparse module makes it easy to write user-friendly command-line interfaces. The program defines what arguments it requires, and argparse will figure out how to parse those out of sys.argv. The argparse module also automatically generates help and usage messages and issues errors when users give the program invalid arguments.

This is just a general solution as the question currently contains no code.

Sign up to request clarification or add additional context in comments.

1 Comment

Attached my request image snippet above

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.