How to Connect Selenium Grid -Hub with Android Emulator using selendroid For web testing

2,369 views
Skip to first unread message

Neil Anderssion

unread,
Jan 8, 2014, 6:32:34 AM1/8/14
to seleniu...@googlegroups.com
Hi

I am using selenium grid for distributed web testing. i have used Android driver for testing web application in android real device or emulator.


Previously when i used Android driver , at that time to connect android device or emulator to grid hub  for parallel testing [ i.e in multiple browser in different operating system as well as in different devices ]  i used  flynnid but now using flynid i am not able to connect with grid hub.

Can you suggest me how to connect selenium grid hub with android emulator/device using selendroid. what are the steps required.

Krishnan Mahadevan

unread,
Jan 8, 2014, 9:26:07 AM1/8/14
to Selenium Users
Have you read here ? http://selendroid.io/scale.html

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/


--
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 post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/321c1dd1-c3bc-4e81-bfee-5f8f6d821279%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Neil Anderssion

unread,
Jan 8, 2014, 3:04:48 PM1/8/14
to seleniu...@googlegroups.com
yes i read that and triend to omplement that but its showing error in cmd promp, " main method missing org.openqa.grid.selenium.GridLauncher "
see the screenshot.

i want to mention i have kept selendroind jar ,selenium jar and selendroid plugin jar in the same drive of my harddisk

Please tell me where i am doing it wrong and tell me the necessary steps to run it properly.


--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/Fz962Vraaio/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.

To post to this group, send email to seleniu...@googlegroups.com.
error.png

Krishnan Mahadevan

unread,
Jan 8, 2014, 8:47:26 PM1/8/14
to seleniu...@googlegroups.com
You are using colon to seperate jar names in the -cp part. I think in Windows you should use semi-colon. 
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CALAH4mr%3Dwv1q_YRqnjrh1XDh_cenbfwLTwzenR3h%2B6rcr5j1rA%40mail.gmail.com.

For more options, visit https://groups.google.com/groups/opt_out.


--

Neil Anderssion

unread,
Jan 9, 2014, 4:27:49 AM1/9/14
to seleniu...@googlegroups.com
Hi Krishnan

i tried as per your suggestion [ i.e altering : by ;  ] now grid server is started correctly.

Now to add android emulator [ may be in same machine where the server is running  or it can run in remote machine also]   i followed the  instruction which is given n the http://selendroid.io/scale.html page


curl -H "Content-Type: application/json" -X POST --data @selendroid-nodes-config.json http://localhost:4444/grid/register

As I  am working in  windows 7 pc [ 32 bit] , so curl  command was not working initially   for that i searched in google and download  from this link http://www.confusedbycode.com/curl/ [ With Administrator Privileges ] msi file

After installing curl i set the curl path in my windows environment variable.

i prepare the selendroid-nodes-config.json   as suggested in the scale page just ignored the "aut": "io.selendroid.testapp:0.7.0"  parameters as i am testing for web
i have attached my json file

now  when i am trying to run the below command
curl -H
"Content-Type: application/json" -X POST --data @selendroid-nodes-config.json http://localhost:4444/grid/register

its showing ok in the command prompt  but  in the cmd of grid server it showing  error

i have attached the screenshot of that error

please suggest me how to fix this problem and if i want to  add emulator or device which is attach with a remote machine then also what modification i have to make.










On Thursday, January 9, 2014 7:17:26 AM UTC+5:30, Krishnan wrote:
You are using colon to seperate jar names in the -cp part. I think in Windows you should use semi-colon. 

On Thursday, January 9, 2014, Neil Anderssion wrote:
yes i read that and triend to omplement that but its showing error in cmd promp, " main method missing org.openqa.grid.selenium.GridLauncher "
see the screenshot.

i want to mention i have kept selendroind jar ,selenium jar and selendroid plugin jar in the same drive of my harddisk

Please tell me where i am doing it wrong and tell me the necessary steps to run it properly.
On Wed, Jan 8, 2014 at 7:56 PM, Krishnan Mahadevan <krishnan.mahadevan1978@gmail.com> wrote:
Have you read here ? http://selendroid.io/scale.html

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/


On Wed, Jan 8, 2014 at 5:02 PM, Neil Anderssion <testeri...@gmail.com> wrote:
Hi

I am using selenium grid for distributed web testing. i have used Android driver for testing web application in android real device or emulator.


Previously when i used Android driver , at that time to connect android device or emulator to grid hub  for parallel testing [ i.e in multiple browser in different operating system as well as in different devices ]  i used  flynnid but now using flynid i am not able to connect with grid hub.

Can you suggest me how to connect selenium grid hub with android emulator/device using selendroid. what are the steps required.

--
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-users+unsubscribe@googlegroups.com.

To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/Fz962Vraaio/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
selendroid-nodes-config.json
error.png

Neil Anderssion

unread,
Jan 9, 2014, 9:12:25 AM1/9/14
to seleniu...@googlegroups.com


Hi Krishnan

Hi krishnan

I was forgot to start selendroid standalone server at port 5555 thats why it was not registering that node to the grid.
but now the problem is grid server not able to forward  the request to the emulator

the steps i followed is mention below



1 First started selendroid server in port 5555

2 then i started the grid using this command

java -Dfile.encoding=UTF-8 -cp "selendroid-grid-plugin-0.7.0.jar;selenium-server-standalone-2.39.0.jar" org.openqa.grid.selenium.GridLauncher -capabilityMatcher io.selendroid.grid.SelendroidCapabilityMatcher -role hub -host 127.0.0.1 -port 4444

3 Then register the android node with hub using jason file using the following command

curl -H "Content-Type: application/json" -X POST --data @selendroid-nodes-config.json http://localhost:4444/grid/register

4 Now i open the http://localhost:4444/grid/console url in firefox browser and confirmed that grid has registered that emulator node

5 Now i make some changes in the code

if (platform.equalsIgnoreCase("Andorid")){
SelendroidCapabilities caps1 =
SelendroidCapabilities.emulator(DeviceTargetPlatform.ANDROID18, "selendroid");
// caps1.setLocale("en_GB");

    driver = new SelendroidDriver("http://localhost:4444/wd/hub", caps1);

    }

else{
driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"),caps);

    }

i have make this changes so that i can run parallel testing in different browsers as well as in different devices

5 Now when i am trying to run my testng.xml file it is failing always

i have attached the screenshot [ red mark section is my code, blue mark section is te cmd response of grid hub and brown mark section is the error showing in the eclipse ]

i have also attached my json file as well


Please tell me where i am doing it wrong












error2.jpg
json.jpg
Reply all
Reply to author
Forward
0 new messages