Forum Discussion
ccdssv1
11 years agoContributor
HI,
This can be easy done by using selenium and groovy script:
Step 1. Download selenium server and place it in <SoapUi Folder>/bin/ext: http://selenium-release.storage.googlea ... 2.43.1.jar
Step 2. If you are using an older soapUI version like me (4.6.4) you need to upgrade the http client libs http://mirror.tcpdiag.net/apache//httpc ... .5-bin.zip , unpack this in to <SoapUI Folder>/Lib
NOTE: since you have new version of this libs you need to delete the old one that ar found in your lib folder, just look at the version number from file name and delete the old version (small nr)
Step 3. Start SoapUI if you did the steps correct you should see in the soapUI Log tab : Wed Oct 22 20:18:12 EEST 2014:INFO:Adding [......\SoapUI-4.6.4-m-SNAPSHOT\bin\ext\selenium-server-standalone-2.43.1.jar] to extensions classpath
Step 4. Create an groovy script that will use selenium to login you on facebook website:
This can be easy done by using selenium and groovy script:
Step 1. Download selenium server and place it in <SoapUi Folder>/bin/ext: http://selenium-release.storage.googlea ... 2.43.1.jar
Step 2. If you are using an older soapUI version like me (4.6.4) you need to upgrade the http client libs http://mirror.tcpdiag.net/apache//httpc ... .5-bin.zip , unpack this in to <SoapUI Folder>/Lib
NOTE: since you have new version of this libs you need to delete the old one that ar found in your lib folder, just look at the version number from file name and delete the old version (small nr)
Step 3. Start SoapUI if you did the steps correct you should see in the soapUI Log tab : Wed Oct 22 20:18:12 EEST 2014:INFO:Adding [......\SoapUI-4.6.4-m-SNAPSHOT\bin\ext\selenium-server-standalone-2.43.1.jar] to extensions classpath
Step 4. Create an groovy script that will use selenium to login you on facebook website:
import org.openqa.selenium.By
import org.openqa.selenium.WebDriver
import org.openqa.selenium.WebElement
import org.openqa.selenium.firefox.FirefoxDriver
userData = "facebook user "
passData = "facebook password"
WebDriver driver = new FirefoxDriver()
driver.navigate().to("https://www.facebook.com/")
//Input the user credentials and authorize the application;
if (driver.findElements(By.id("email")).size() == 1 ){
driver.findElement(By.id("email")).sendKeys(userData)
driver.findElement(By.id("pass")).sendKeys(passData)
driver.findElement(By.id("loginbutton")).click()
//you should be logged on the facebook page and do stuf here :)
} else log.info "Fail to load the facebook page"
driver.quit()
Related Content
- 2 months ago
- 12 years ago
- 14 years ago
- 5 years ago
- 3 years ago
Recent Discussions
- 15 years ago