Running a test case on a webpage that is already o

2019-03-04 23:07发布

问题:

I want to run my test cases via protractor, but due to some limitation I want protractor to start on a page that is already open, meaning I don't want driver to start by loading chrome and going to the url defined in test case. Is there any way if I can use the url that is already opened on screen and then process further with what is defined in the test case such as clicking on elements or sending keys etc.

Regards Syed Zaidy

回答1:

This feature is not implemented in selenium. It was requested but rejected because it is not feasible. If you read the issue here, and scroll down to last comment :

I'm going to make a call on this one: it's a browser specific feature, and not something that we can implement in a general way. With IE, it's possible to iterate over the open windows in the OS and find the right IE process to attach to.

Firefox and Chrome, OTOH, need to be started in a specific mode and configuration, which means that just attaching to a running instance isn't technically possible.

Closing as "not feasible" here as this is a browser specific feature.