Selecting information from a dynamic dropdown

yes it is,
WebUI.click(findTestObject(‘Page_Southwark/address_select’, [(‘Address1Str’) : ‘Address1Str’]))
is the command I am using
With
//form[@id=‘create_account_form’]/div[4]/div[2]/div/div/div/ul/li[contains(text(),‘${Address1Str}’)]/a
being the xpath in use.

is there anything specific that you would like, I can paste the entire thing if you want.

Yes, please paste the entire test script, the entire console log too, along with a screenshot of the page at the time the test fails. If you’re using Click, then is the dropdown item visible at the time the click is initiated ? I suspect the dropdown items are created dynamically, so try to click on the input (which an end user would click to display the dropdown).

Your problem is that you are using the value “Address1Str” itself in the selector, and not the variable Address1Str. You will need to remove the quotes around it, so:

WebUI.click(findTestObject(‘Page_Southwark/address_select’, [(‘Address1Str’) : Address1Str]))

1 Like

Thanks @r.klein1. Nice catch, I didn’t see that.

This is the console log and the test script that I am using, all of the other parameterised commands are working perfectly. Here is the screenshot of where it is failing, the address its looking for is further down on the popup. It wont select even if I manually scroll all the way down to it although I know this shouldnt make much difference

Console

2020-01-30 08:35:42.864 INFO c.k.katalon.core.main.TestCaseExecutor - START Test Cases/user account input
2020-01-30 08:35:42.925 INFO c.k.katalon.core.main.TestCaseExecutor - First_Name = some
2020-01-30 08:35:42.926 INFO c.k.katalon.core.main.TestCaseExecutor - Last_Name = woman
2020-01-30 08:35:42.928 INFO c.k.katalon.core.main.TestCaseExecutor - Telephone1 = 07900000003
2020-01-30 08:35:42.929 INFO c.k.katalon.core.main.TestCaseExecutor - Telephone2 =
2020-01-30 08:35:42.943 INFO c.k.katalon.core.main.TestCaseExecutor - Email = stan.sole.fgl+1@gmail.com
2020-01-30 08:35:42.945 INFO c.k.katalon.core.main.TestCaseExecutor - Postcode = E82AW
2020-01-30 08:35:42.946 INFO c.k.katalon.core.main.TestCaseExecutor - Address1 = Flat A, 183 Amhurst Road
2020-01-30 08:35:43.855 DEBUG testcase.user account input - 1: Address1Str = Address1
2020-01-30 08:35:43.860 DEBUG testcase.user account input - 2: Address1Str = Address1Str.toUpperCase()
2020-01-30 08:35:43.867 DEBUG testcase.user account input - 3: println(Address1Str)
FLAT A, 183 AMHURST ROAD
2020-01-30 08:35:43.881 DEBUG testcase.user account input - 4: openBrowser(“”)
2020-01-30 08:35:44.574 INFO c.k.k.core.webui.driver.DriverFactory - Starting ‘Firefox’ driver
Jan 30, 2020 8:35:44 AM org.openqa.selenium.remote.DesiredCapabilities firefox
INFO: Using new FirefoxOptions() is preferred to DesiredCapabilities.firefox()
2020-01-30 08:35:44.798 INFO c.k.k.core.webui.driver.DriverFactory - Action delay is set to 0 seconds
1580373346672 mozrunner::runner INFO Running command: “C:\Program Files\Mozilla Firefox\firefox.exe” “-marionette” “-foreground” “-no-remote” “-profile” “C:\Users\STANSO~1\AppData\Local\Temp\rust_mozprofile.oRJnQwM5frzA”
1580373347119 addons.webextension. WARN Loading extension ‘null’: Reading manifest: Warning processing permissions: Error processing permissions.12: Value “debugger” must either: must either [must either [be one of [“clipboardRead”, “clipboardWrite”, “geolocation”, “idle”, “notifications”], be one of [“bookmarks”], be one of [“find”], be one of [“history”], be one of [“menus.overrideContext”], be one of [“search”], be one of [“topSites”], be one of [“activeTab”, “tabs”, “tabHide”], be one of [“browserSettings”], be one of [“cookies”], be one of [“downloads”, “downloads.open”], be one of [“webNavigation”], or be one of [“webRequest”, “webRequestBlocking”]], be one of [“alarms”, “mozillaAddons”, “storage”, “unlimitedStorage”], be one of [“browsingData”], be one of [“captivePortal”], be one of [“devtools”], be one of [“identity”], be one of [“menus”, “contextMenus”], be one of [“normandyAddonStudy”], be one of [“pkcs11”], be one of [“geckoProfiler”], be one of [“sessions”], be one of [“urlbar”], be one of [“contextualIdentities”], be one of [“dns”], be one of [“activityLog”], be one of [“management”], be one of [“networkStatus”], be one of [“privacy”], be one of [“proxy”], be one of [“nativeMessaging”], be one of [“telemetry”], be one of [“theme”], or match the pattern /^experiments(.\w+)+$/], or must either [be one of [“<all_urls>”], must either [match the pattern /^(https?|wss?|file|ftp|*)://(*|*.[^/]+|[^/]+)/.$/, or match the pattern /^file:///.$/], or match the pattern /^resource://(*|*.[^/]+|[^/]+)/.$|^about:/]
1580373347120 addons.webextension. WARN Loading extension ‘null’: Reading manifest: Warning processing offline_enabled: An unexpected property was found in the WebExtension manifest.
1580373347181 addons.webextension.doh-rollout@mozilla.org WARN Loading extension ‘doh-rollout@mozilla.org’: Reading manifest: Invalid extension permission: networkStatus
1580373347207 addons.webextension.screenshots@mozilla.org WARN Loading extension ‘screenshots@mozilla.org’: Reading manifest: Invalid extension permission: mozillaAddons
1580373347207 addons.webextension.screenshots@mozilla.org WARN Loading extension ‘screenshots@mozilla.org’: Reading manifest: Invalid extension permission: telemetry
1580373347207 addons.webextension.screenshots@mozilla.org WARN Loading extension ‘screenshots@mozilla.org’: Reading manifest: Invalid extension permission: resource://pdf.js/
1580373347207 addons.webextension.screenshots@mozilla.org WARN Loading extension ‘screenshots@mozilla.org’: Reading manifest: Invalid extension permission: about:reader

1580373347752 addons.webextension.{54dcd9e9-903f-43e9-95f0-22bd0e0f3c0a} WARN Loading extension ‘{54dcd9e9-903f-43e9-95f0-22bd0e0f3c0a}’: Reading manifest: Warning processing permissions: Error processing permissions.12: Value “debugger” must either: must either [must either [be one of [“clipboardRead”, “clipboardWrite”, “geolocation”, “idle”, “notifications”], be one of [“bookmarks”], be one of [“find”], be one of [“history”], be one of [“menus.overrideContext”], be one of [“search”], be one of [“topSites”], be one of [“activeTab”, “tabs”, “tabHide”], be one of [“browserSettings”], be one of [“cookies”], be one of [“downloads”, “downloads.open”], be one of [“webNavigation”], or be one of [“webRequest”, “webRequestBlocking”]], be one of [“alarms”, “mozillaAddons”, “storage”, “unlimitedStorage”], be one of [“browsingData”], be one of [“captivePortal”], be one of [“devtools”], be one of [“identity”], be one of [“menus”, “contextMenus”], be one of [“normandyAddonStudy”], be one of [“pkcs11”], be one of [“geckoProfiler”], be one of [“sessions”], be one of [“urlbar”], be one of [“contextualIdentities”], be one of [“dns”], be one of [“activityLog”], be one of [“management”], be one of [“networkStatus”], be one of [“privacy”], be one of [“proxy”], be one of [“nativeMessaging”], be one of [“telemetry”], be one of [“theme”], or match the pattern /^experiments(.\w+)+$/], or must either [be one of [“<all_urls>”], must either [match the pattern /^(https?|wss?|file|ftp|*)://(*|*.[^/]+|[^/]+)/.$/, or match the pattern /^file:///.$/], or match the pattern /^resource://(*|*.[^/]+|[^/]+)/.*$|^about:/]
1580373347752 addons.webextension.{54dcd9e9-903f-43e9-95f0-22bd0e0f3c0a} WARN Loading extension ‘{54dcd9e9-903f-43e9-95f0-22bd0e0f3c0a}’: Reading manifest: Warning processing offline_enabled: An unexpected property was found in the WebExtension manifest.
JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can’t find profile directory.
1580373349635 Marionette INFO Listening on port 49357
1580373349789 Marionette WARN TLS certificate errors will be ignored for this session
1580373349796 Marionette INFO Proxy settings initialised: {“proxyType”:“direct”}
Jan 30, 2020 8:35:49 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
2020-01-30 08:35:50.028 INFO c.k.k.core.webui.driver.DriverFactory - sessionId = 992d270f-2a69-4aa0-8cb3-a03ccdd97dbb
2020-01-30 08:35:50.050 INFO c.k.k.core.webui.driver.DriverFactory - browser = Firefox 72.0
2020-01-30 08:35:50.053 INFO c.k.k.core.webui.driver.DriverFactory - platform = Windows 10
2020-01-30 08:35:50.054 INFO c.k.k.core.webui.driver.DriverFactory - seleniumVersion = 3.141.59
2020-01-30 08:35:50.058 INFO c.k.k.core.webui.driver.DriverFactory - proxyInformation = ProxyInformation{proxyOption=NO_PROXY, proxyServerType=HTTP, password=, proxyServerAddress=, proxyServerPort=0}
2020-01-30 08:35:50.077 DEBUG testcase.user account input - 5: navigateToUrl(“https://someurl”)
2020-01-30 08:35:51.766 DEBUG testcase.user account input - 6: setText(findTestObject(“Object Repository/Page_Southwark/input_Email_USERNAME”), “fglstan”)
2020-01-30 08:35:52.427 DEBUG testcase.user account input - 7: setEncryptedText(findTestObject(“Object Repository/Page_Southwark/input_Password_PASSWORD”), “035kGmwXzRp0n/1sehi05g==”)
2020-01-30 08:35:52.947 DEBUG testcase.user account input - 8: click(findTestObject(“Object Repository/Page_Southwark/button_Submit”))
2020-01-30 08:35:55.725 DEBUG testcase.user account input - 9: click(findTestObject(“Object Repository/Page_Southwark/a_Create”))
2020-01-30 08:35:58.264 DEBUG testcase.user account input - 10: click(findTestObject(“Object Repository/Page_Southwark/button_Title”))
2020-01-30 08:35:58.980 DEBUG testcase.user account input - 11: click(findTestObject(“Object Repository/Page_Southwark/a_Mx”))
2020-01-30 08:35:59.605 DEBUG testcase.user account input - 12: selectOptionByLabel(findTestObject(“Object Repository/Page_Southwark/select_Title Dr Miss Mr Mrs _c4afce”), “Mx”, true)
2020-01-30 08:36:00.687 DEBUG testcase.user account input - 13: setText(findTestObject(“Page_Southwark/input_First Name_USER_FIRST_NAME”, [“First_Name”:“First_Name”]), First_Name)
2020-01-30 08:36:01.077 DEBUG testcase.user account input - 14: setText(findTestObject(“Page_Southwark/input_Surname_USER_LAST_NAME”, [“Last_Name”:“Last_Name”]), Last_Name)
2020-01-30 08:36:01.637 DEBUG testcase.user account input - 15: setText(findTestObject(“Object Repository/Page_Southwark/input_Telephone No_CUSTOMER_HOME_CONTACT”, [“Telephone1”:“Telephone1”]), Telephone1)
2020-01-30 08:36:02.207 DEBUG testcase.user account input - 16: setText(findTestObject(“Object Repository/Page_Southwark/input_Alt Telephone No_CUSTOMER_MOBILE_CONTACT”, [“Telephone2”:“Telephone2”]), Telephone2)
2020-01-30 08:36:02.652 DEBUG testcase.user account input - 17: setText(findTestObject(“Object Repository/Page_Southwark/input_Email_CUSTOMER_EMAIL”, [“Email”:“Email”]), Email)
2020-01-30 08:36:03.222 DEBUG testcase.user account input - 18: setText(findTestObject(“Object Repository/Page_Southwark/input_Repeat Email_repeat_email”, [“Email”:“Email”]), Email)
2020-01-30 08:36:04.115 DEBUG testcase.user account input - 19: setText(findTestObject(“Object Repository/Page_Southwark/input_Postcode Lookup_CUSTOMER_POSTAL_CODE”, [“Postcode”:“Postcode”]), Postcode)
2020-01-30 08:36:04.614 DEBUG testcase.user account input - 20: click(findTestObject(“Object Repository/Page_Southwark/i_Postcode Lookup_glyphicon glyphicon-search”))
2020-01-30 08:36:05.274 DEBUG testcase.user account input - 21: click(findTestObject(“Object Repository/Page_Southwark/span_2 Willersley Avenue Sidcup Kent DA15 9EW”))
2020-01-30 08:36:06.630 DEBUG testcase.user account input - 22: click(findTestObject(“Page_Southwark/address_select”, [“Address1Str”:Address1Str]))
2020-01-30 08:36:50.976 INFO c.k.k.c.webui.common.WebUiCommonHelper - Unable to find the element located by ‘By.xpath: //form[@id=‘create_account_form’]/div[4]/div[2]/div/div/div/ul/li[contains(text(),‘FLAT A, 183 AMHURST ROAD’)]’. Please recheck the objects properties to make sure the desired element is located.
2020-01-30 08:36:51.142 ERROR c.k.k.core.keyword.internal.KeywordMain - :x: Unable to click on object ‘Object Repository/Page_Southwark/address_select’ (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to click on object ‘Object Repository/Page_Southwark/address_select’
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.click(ClickKeyword.groovy:79)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:42)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:60)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:616)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$3.call(Unknown Source)
at user account input.run(user account input:70)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestCaseMainPhase(TestSuiteExecutor.java:169)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:142)
at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:91)
at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:157)
at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
at TempTestSuite1580373336211.run(TempTestSuite1580373336211.groovy:36)
Caused by: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Page_Southwark/address_select’ located by ‘By.xpath: //form[@id=‘create_account_form’]/div[4]/div[2]/div/div/div/ul/li[contains(text(),‘FLAT A, 183 AMHURST ROAD’)]’ not found
at com.kms.katalon.core.webui.common.WebUiCommonHelper.findWebElement(WebUiCommonHelper.java:1113)
at com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword.findWebElement(WebUIAbstractKeyword.groovy:27)
at com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword.findWebElement(WebUIAbstractKeyword.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.doCall(ClickKeyword.groovy:52)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.call(ClickKeyword.groovy)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.click(ClickKeyword.groovy:79)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:42)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:60)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:616)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$3.call(Unknown Source)
at Script1578992957925.run(Script1578992957925.groovy:70)
… 13 more
)
2020-01-30 08:36:51.149 ERROR c.k.katalon.core.main.TestCaseExecutor - :x: Test Cases/user account input FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to click on object ‘Object Repository/Page_Southwark/address_select’
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.click(ClickKeyword.groovy:79)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:42)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:60)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:616)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$3.call(Unknown Source)
at user account input.run(user account input:70)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestCaseMainPhase(TestSuiteExecutor.java:169)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:142)
at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:91)
at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:157)
at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
at TempTestSuite1580373336211.run(TempTestSuite1580373336211.groovy:36)
Caused by: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Page_Southwark/address_select’ located by ‘By.xpath: //form[@id=‘create_account_form’]/div[4]/div[2]/div/div/div/ul/li[contains(text(),‘FLAT A, 183 AMHURST ROAD’)]’ not found
at com.kms.katalon.core.webui.common.WebUiCommonHelper.findWebElement(WebUiCommonHelper.java:1113)
at com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword.findWebElement(WebUIAbstractKeyword.groovy:27)
at com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword.findWebElement(WebUIAbstractKeyword.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.doCall(ClickKeyword.groovy:52)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.call(ClickKeyword.groovy)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
… 19 more

2020-01-30 08:36:51.154 INFO c.k.katalon.core.main.TestCaseExecutor - END Test Cases/user account input

Test Case

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.Keys as Keys

String Address1Str = Address1

Address1Str = Address1Str.toUpperCase();

println(Address1Str)

WebUI.openBrowser(‘’)

WebUI.navigateToUrl(‘someurl’)

WebUI.setText(findTestObject(‘Object Repository/Page_Southwark/input_Email_USERNAME’), ‘fglstan’)

WebUI.setEncryptedText(findTestObject(‘Object Repository/Page_Southwark/input_Password_PASSWORD’), ‘035kGmwXzRp0n/1sehi05g==’)

WebUI.click(findTestObject(‘Object Repository/Page_Southwark/button_Submit’))

WebUI.click(findTestObject(‘Object Repository/Page_Southwark/a_Create’))

WebUI.click(findTestObject(‘Object Repository/Page_Southwark/button_Title’))

WebUI.click(findTestObject(‘Object Repository/Page_Southwark/a_Mx’))

WebUI.selectOptionByLabel(findTestObject(‘Object Repository/Page_Southwark/select_Title Dr Miss Mr Mrs _c4afce’),
‘Mx’, true)

WebUI.setText(findTestObject(‘Page_Southwark/input_First Name_USER_FIRST_NAME’, [(‘First_Name’) : ‘First_Name’]), First_Name)

WebUI.setText(findTestObject(‘Page_Southwark/input_Surname_USER_LAST_NAME’, [(‘Last_Name’) : ‘Last_Name’]), Last_Name)

WebUI.setText(findTestObject(‘Object Repository/Page_Southwark/input_Telephone No_CUSTOMER_HOME_CONTACT’, [(‘Telephone1’) : ‘Telephone1’]),
Telephone1)

WebUI.setText(findTestObject(‘Object Repository/Page_Southwark/input_Alt Telephone No_CUSTOMER_MOBILE_CONTACT’, [(‘Telephone2’) : ‘Telephone2’]),
Telephone2)

WebUI.setText(findTestObject(‘Object Repository/Page_Southwark/input_Email_CUSTOMER_EMAIL’, [(‘Email’) : ‘Email’]), Email)

WebUI.setText(findTestObject(‘Object Repository/Page_Southwark/input_Repeat Email_repeat_email’, [(‘Email’) : ‘Email’]),
Email)

WebUI.setText(findTestObject(‘Object Repository/Page_Southwark/input_Postcode Lookup_CUSTOMER_POSTAL_CODE’, [(‘Postcode’) : ‘Postcode’]),
Postcode)

WebUI.click(findTestObject(‘Object Repository/Page_Southwark/i_Postcode Lookup_glyphicon glyphicon-search’))

WebUI.click(findTestObject(‘Object Repository/Page_Southwark/span_2 Willersley Avenue Sidcup Kent DA15 9EW’))

WebUI.click(findTestObject(‘Page_Southwark/address_select’, [(‘Address1Str’) : Address1Str]))

WebUI.click(findTestObject(‘Object Repository/Page_Southwark/button_Submit’))

WebUI.closeBrowser()

edit:
I have tried the change suggested in the above comment as can be seen in my script

INFO c.k.k.c.webui.common.WebUiCommonHelper - Unable to find the element located by ‘By.xpath: //form[@id=‘create_account_form’]/div[4]/div[2]/div/div/div/ul/li[contains(text(),‘FLAT A, 183 AMHURST ROAD’)]’. Please recheck the objects properties to make sure the desired element is located.

Since you keep insisting in using that xpath with /div[4]/div[2]/div/div/… etc… it’s bound to go wrong… it’s too specific. See my xpath example mentioned earlier.

Also you are clicking on:

WebUI.click(findTestObject(‘Object Repository/Page_Southwark/span_2 Willersley Avenue Sidcup Kent DA15 9EW’))

What does that do? Doesn’t that close the select with all the options?

I did try your suggested path but it didnt work giving the same error.

the dropdown doesnt automatically open so clicking it is what opens the dropdown

I strongly recommend you install SelectorsHub Pro and watch this youtube video:

1 Like