0

I have a scenario where I need a value which would be generated by running a python script in the middle of UI based automation script written in C#. Can it be possible to run a python script and provide a value to it and get the result from the python script as input to my UI automation script?

My current automation framework is Selenium using N-unit, and the scenario would be run in Chrome browser

here is the python script which I would be using

(import XYZ

random_message = input("Please enter the message to be signed")
print("Message to be signed is %s" %random_message)

private_key = input("Please input firstvalue:")
print("Your wallet firstvalueis: %s" %firstvalue)

Converted_Value= XYZ.firstvalue_to_Converted_Value(firstvalue)

hex_compressed_firstvalue = bitcoin.encode_firstvalue(firstvalue,'hex_compressed')
print("Your compressed firstvalue is:", hex_compressed_public_key)

hex_addr = XYZ.pubtoaddr(hex_compressed_firstvalue)
print("Your wallet address is:", hex_addr)

signed_message = XYZ.ecdsa_sign(random_message, Converted_Value)
print("Signed message is: ", signed_message)

)
Ben Amos
  • 1,750
  • 15
  • 18
Ravi Teja
  • 1
  • 1
  • I am fairly certain the answer will be language-specific because Selenium WebDriver is available in so many languages. Which language are you writing your Selenium automations in? Python? Ruby? Java? Also, how are your Selenium automations typically executed? An automation service like Jenkins or cron? Are you running them from within an IDE? Or are you entering commands in the console? If so, what's the command? – Ben Amos Sep 11 '19 at 22:11
  • Welcome to SO. Please take the time to read [ask]. It will help you craft solid questions that will hopefully get useful answers. Sounds like you are using C#. Why not generate the token/value using C# in your selenium script? And prompting for user input in the middle of automated test is unusual IMO. YMMV. – orde Sep 11 '19 at 23:57
  • @BenAmos I am writing my scripts in C# language and currently I am executing the scripts manually, but I have a pipeline setup ready which I would be using in future to trigger my automation scripts.And I am running my scripts using Visual Studio 2017 and I wont enter the input value from console, I will store those values in a excel file and I will read from that excel file during the execution and send them as input to the Python scripts. Hope this information might be helpful in providing a solution to me – Ravi Teja Sep 12 '19 at 01:50
  • Possible duplicate of [How do I run a Python script from C#?](https://stackoverflow.com/questions/11779143/how-do-i-run-a-python-script-from-c) – Ben Amos Sep 13 '19 at 18:56

0 Answers0