質問

I would like to use selenium to test how two or more applications (main, monitoring, management) work together. However all I was able to find is how to test a single application.

Sample scenarios could look like this:

App 1 - user x tries to log in, but has no account and the login fails
App 2 - a user for App 1 is created
App 1 - user is now able to log in

App 1 - user x performs a task
App 2 - displays the performed task
App 1 - user x finishes a task
App 2 - displays the finished task

The applications may be deployed on different servers. the communication is performed over a common database. The applications are not necessarily implemented using the same technology stack.

役に立ちましたか?

解決

Selenium is meant to replicate real user behavior. So if the session does terminate on navigating away from APP 1 when a real user would do it, then the exact same behavior is seen when running these steps via selenium webdriver.

If you still wish to do i, it can be done this way -

@driver1 = Selenium::WebDriver.for(:remote, :url => @sel_grid_url, :desired_capabilities => @browser) #create a browser session controlled by driver1
@driver2 = Selenium::WebDriver.for(:remote, :url => @sel_grid_url, :desired_capabilities => @browser) #create another browser session controlled by driver2
@driver1.get "http://#{app1}/"
## user x tries to log in, but has no account and the login fails
@driver2.get "http://#{app2}"
## a user for App 1 is created
.
.
.

The above code is in Ruby, and has been implemented with Selenium Grid 2 is the middle.

他のヒント

Selenium IDE doesn't allow you to change website during the same test. But you can easily do this with Selenium Webdriver. For example

driver.get("yourFirstApp.com");
//Test your stuff
driver.get("yourSecondApp.com");
//Test your stuff
etc

If you stay in the same testcase like the code bellow you'll have no trouble with the conversation ID, session etc..

@Test
public void blablalb() {  
driver.get(a1);  
//code.... 
driver.get(a2);  
//code...
}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top