I have selenium grid working with local and remote nodes from a test started in robotframework. I do not want to control selenium startup from within the robot test, I just want to say give me access to a selenium-node that is using a gateway which is the device under test(DUT). I want to in essence access specific nodes based on desired_criteria ~= mgmt in testbed1, client-interface in testbed1. Do I need a grid per testbed? It seems I need to associate a grid with a specific testbed and have another selenium running for the management interface.

Client ----------- DUT --------- Server
  node      |       | mgmt interface
192.168/24  |       | 
            |       |
       localhost ---- 10.0.1.1
     hub + node + robot runner

I tried specifying platform=LINUX for client-node and platform=UNIX for local-node and thats not working in Open Browser. Now attempting use of robotframework_selenium2library, since I thought it was a drop in!

https://github.com/detro/ghostdriver/blob/master/README.md may provide a way to seperate instances, but it is still one instance running on a specific node, if I disable firefox on the client browsers and use that for manager access it will give me what I need - (hack! hack! hairball).

有帮助吗?

解决方案

The key to solve this is to know which instance of selenium you are refering to when you call open_browser and that can be controlled by being explicit refering to the Selenium remote RC client_web.open_browser or by using Keyword Set Library Search Order.

*** Settings ***
Library  SeleniumLibrary  120  ${CLIENT_IP}  ${SELENIUM_SERVER_PORT}  WITH NAME  client_web

*** Variables ***
${MANAGER_BROWSER}   Firefox
${BROWSER}   Firefox

*** Test Cases ***
Verify Two Browsers Using Search Order
    [Setup]  Test Case Setup
    [Tags]  noncritical  
    Set Library Search Order  SeleniumLibrary
    ${wb_index} =  Open Browser  ${DUT}  ${MANAGER_BROWSER}
    Set Library Search Order  client_web
    ${wb_index} =  Open Browser  ${facebook}  ${BROWSER}
    Maximize Browser Window
    Select Window  main
    Wait Until Page Contains  ${page text}  10s
    Log  browser-index:${wb_index}
    Comment  Set suite variable Manager_Browser with call to open specific browser
    [Teardown]  Local Test Case Teardown
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top