Object defination for keyboard entries

Hi good people,
My testcase has a line as line of code:
WebUI.sendKeys(findTestObject(‘Input’), Keys.chord(‘Text String’, Keys.ENTER )) this means I have to hit keyboard for my url to run.
When I run the testcase it passes but I am getting two red lines with content:

Note that: record method did not work hence I am using script mode.

1 Like

The error message (red line) is clear. If you look in your Object Repository you will see you don’t have a Test Object with the id “Input”.

To fix: correct your code OR correct your Test Object. They should MATCH.

1 Like

2023-08-03 23:52:04.869 INFO c.k.k.c.webui.common.WebUiCommonHelper - Unable to find the element located by ‘By.xpath: //*[matches(@id, ‘Input’)]’. Please recheck the objects properties to make sure the desired element is located.
2023-08-03 23:52:04.872 WARN c.k.k.c.webui.common.WebUiCommonHelper - [SELF-HEALING] Failed to find element with id ‘Object Repository/Input’. Try using Self-healing.
2023-08-03 23:52:05.895 INFO c.k.k.c.webui.common.WebUiCommonHelper - Unable to find the element located by 'By.xpath: '. Please recheck the objects properties to make sure the desired element is located.
2023-08-03 23:52:06.896 INFO c.k.k.c.webui.common.WebUiCommonHelper - [SELF-HEALING] No working XPath is found.
BELOW is the object settings



what I am automating is ussd emulator where all parameters are passed in url then pressing enter key

1 Like

“matches” is not a valid XPath function name.

1 Like

I tried matches, equal , contains all in vain
what is your suggestion?

1 Like

You haven’t showed the HTML source of your target HTML, so I am not very sure, but I guess your HTML has an <iframe> element. Your target element resides inside the <iframe>. In this case you need to pay special attention to the <iframe> but you are not doing so.

Have a look at the following:

1 Like

Hi, I am not sure if you understood my challenge…
I have a URL…
Steps as follow:

  1. put URL eng https/…/…
  2. tab Enter key
    the script for above

    after running the html output as shown below:

    so there is need to ensure 'enter key ’ does not return warnings ie redlines and also ensuring that the right response is displayed.
1 Like

To be honest, no, I don’t understand your challenge.

The HTML you showed above contains no HTML element with id attribute with value Input. That is the very reason why you got an error

2023-08-03 23:52:04.869 INFO c.k.k.c.webui.common.WebUiCommonHelper - 
    Unable to find the element located by ‘By.xpath: //*[matches(@id, ‘Input’)]’. Please recheck the objects properties to make sure the desired element is located.

I do not see what you are going to do.

1 Like

this worked
WebUI.sendKeys(findTestObject(null), Keys.chord(‘Text String’, Keys.ENTER /* , Keys.TAB*/ ))

passing null object.
Thanks though

1 Like

i Hope the basic selenium will help you to understand more about x paths.

2 Likes