Running IE as a different user with Selenium Webdriver in Java

前端 未结 6 740
灰色年华
灰色年华 2021-01-19 02:55

Does anyone know how I could get selenium to run an IE session utilising the \"Run as different user\" function using JAVA? I have no idea how I\'d even go about setting th

6条回答
  •  旧巷少年郎
    2021-01-19 03:37

    Its quite possible i have done it may time. Easy way If you run selenium through eclipse. Just open eclipse IDE by right click open as different user.

    The harder way create a Java>Runnable JAR file as mentioned in the article below.

    https://www.joecolantonio.com/selenium-executable-java-test/

    you should be admin on local machine to do it and should have windows account iusername and password for user:userA user:userA1 and so on. open multiple command prompt

    C:\>runas /user:domainname\userA cmd
    C:\>runas /user:domainname\userA1 cmd
    C:\>runas /user:domainname\userA2 cmd
    

    or

    C:\>runas /user:domainname\username cmd
    

    Enter the password for administrator: Attempting to start cmd as user "techblogger-pc\administrator" ... then type same jar file in command window Like c:\runnableselenium.jar and bomb you have all jar running with different credential Find a way to see the logged in user name on test page somehow.

提交回复
热议问题