Forum Discussion

TheKaiser1978's avatar
TheKaiser1978
New Contributor
14 years ago

Properties in Selenium Webdriver Groovy Steps

Hi All

Long time user, first time poster.

I'm creating Selenium Webdriver groovy steps and would like to pass a Test Case level property into a field and then search.

//Find the Customer with the number
WebElement custno = driver.findElement(By.id("CustomerID"));custno.sendKeys(CustID);

Basically enter the customer number and search. I want to capture this ID from the API request and then check various things in the UI, but obviously I need to find them first.

Any ideas?? More information on request!

Cheers!

1 Reply

  • Done it! As simple as:

    def CustID = testRunner.testCase.getPropertyValue( "CustID" )
    WebElement PopulateCustID = driver.findElement(By.id("CustomerID"));PopulateCustID.sendKeys(CustID);