-1

I'm automating some test cases for a web app using selenium-webdriver and jasmine in protractor. I want each feature to run in a particular order and using the same browser window. For example:

  1. open and login the webapp
  2. Go to some page within the app
  3. Create a new item in this specific page

At this moment I would like to keep the browser aside, and do some manual actions outside the browser. After some actions taken I would like to go back to the browser that is waiting after step 3, and test whether the app behaved as expected for all the other actions I've been doing.

All the relevant information I could get for my scenario is in the following question: How to use same browser window for automated test using selenium-webdriver (ruby)? But it was all Ruby(which I don't know how to refer, or how to manipulate it for my needs).

Y. Serrouya
  • 41
  • 1
  • 10
  • "do some actions outside the browser". you can't do things outside the browser with protractor, except for things like reading files – Gunderson Jul 17 '17 at 12:41
  • Meant to do some manual actions. I would like the browser to go in like 'on hold' state, and wait until I start another test suite that will continue on the same instance. – Y. Serrouya Jul 17 '17 at 12:45
  • That means you can only run the test if someone is there to finish the manual part of it? Doesn't seem to make sense. Why not just automate the manual actions that you need to perform? – Gunderson Jul 17 '17 at 12:48
  • I can automate these actions as well. It's just something that will be happening using python probably, but not protractor. I wish to understand how can I keep the browser instance open, in a way I would be able to reconnect it later with another protractor spec files. – Y. Serrouya Jul 17 '17 at 12:59

1 Answers1

0

In order to connect to an already running webdriver instance:

  1. Run selenium standalone server
  2. Navigate to the server
  3. Click on 'Create Session' and choose your desired browser
  4. Copy the Session id, and the selenium server
  5. In the protractor config file:

    exports.config = {
    
        seleniumAddress: <enter the selenium Address in here as a string>,
    
        seleniumSessionId: <enter session id as string>,
    
        directConnect: null,
    
    }
    

Now each spec file you will run with this configuration file, will run on the instance you opened earlier, and the instance will stay the way it is once the test is done(instead of shutting down)

Y. Serrouya
  • 41
  • 1
  • 10