How to run bat file using winappdriver

180 views
Skip to first unread message

Imrankhan

unread,
Dec 20, 2021, 12:42:58 PM12/20/21
to seleniu...@googlegroups.com
Dear all,

At the outset, please pardon me for the off topic. 

I have been trying to launch a .bat file through WinAppDriver. But, I cannot do so as I am getting session not created exception.

Can someone please tell me how to launch bat file through WinAppDriver?. 

--
Kind Regards,
Imrankhan M

Imrankhan

unread,
Dec 22, 2021, 12:21:04 AM12/22/21
to seleniu...@googlegroups.com
Dear all,

I am seeking your help again.

I request you to share your insights if you have.

Best Regards,
Imran.

⇜Krishnan Mahadevan⇝

unread,
Dec 22, 2021, 1:57:05 AM12/22/21
to Selenium Users
Not sure why you need WinAppDriver to be able to launch a batch file ?
Your programming language by itself should allow you to do that, no?

For e.g., if you were doing it in Java, you would do it like this: https://stackoverflow.com/a/19103715 

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/


On Wed, Dec 22, 2021 at 10:51 AM Imrankhan <itsmei...@gmail.com> wrote:
Dear all,

I am seeking your help again.

I request you to share your insights if you have.

Best Regards,
Imran.

On Mon, Dec 20, 2021 at 11:11 PM Imrankhan <itsmei...@gmail.com> wrote:
Dear all,

At the outset, please pardon me for the off topic. 

I have been trying to launch a .bat file through WinAppDriver. But, I cannot do so as I am getting session not created exception.

Can someone please tell me how to launch bat file through WinAppDriver?. 

--
Kind Regards,
Imrankhan M


--
Kind Regards,
Imrankhan M

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CALtis082aeXimqXFKN16OkdcUvFB%2Bi0PzZF0t4xG2-jLY9Fkig%40mail.gmail.com.

Imrankhan

unread,
Dec 22, 2021, 2:51:16 AM12/22/21
to seleniu...@googlegroups.com
Hello Krishnan,

Thank you for your response!

As soon as I run my batch file, immediately the desktop application will be launched. Hence, I have tried with "ProcessBuilder" to launch the .bat file. But, I was getting an exception that my session wasn't created. 

Hence, I am stuck here.  PFB the screenshot for your reference,

image.png

My queries are as follows,

1. How to run batch file?. 
2. How to pass the control to the application when it gets launched?. 

I humbly request you to provide some information. I will pitch in from there. 

Kindest Regards,
Imran. 

⇜Krishnan Mahadevan⇝

unread,
Dec 22, 2021, 3:19:58 AM12/22/21
to Selenium Users
I believe that WinAppDriver, like all other WebDriver implementations, will be able to work with the App under test, only if it finds it and spawns it on its own.

In your case, you have a batch file which I am guessing is abstracting out some of the instructions that are to be executed together to be able to start your application.

You would need to ensure that you spawn your WebDriver with those arguments.

I found these two links as good pointers that should help you move forward


PS: I have not used WinAppDriver nor do I have a windows machine at my disposal. So I don't think I will be able to be of much help beyond this. Let me take a side step and let someone else help you from here.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/

Imrankhan

unread,
Dec 22, 2021, 3:23:13 AM12/22/21
to seleniu...@googlegroups.com
Thanks, Krishnan for your immediate response!

Let me have a look at the links that you have shared. 

Best Regards,
Imran.

Reply all
Reply to author
Forward
0 new messages