Question

Hi Team, I need help in addressing a SPAN element in a webform

  • 18 February 2022
  • 6 replies
  • 3 views

I created a bot entering data from Excel to a webform. The amount of information varies between 1 - 10 digit number to, lets say, 80 - 10 digit number. The bot s working fine when the amount of 10 digit numbers is not exceeding 4 to 5 entries.

If there are more than 5 entries the bot become erratic by entering incomplete numbers or addressing suddenly fields in the webform never mentioned in the bot.

 

Here is how the numbers look like in the excel sheet:

7620023030|7620023031|7620023232|7620023032

 

This is how the numbers are appearing in the webform:

 

imageThis is absolutely correct.

 

But having e..g 10 entries it looks like this

 

imageThe numbers are all over the place and not even in the format they should be.

 

I'm not sure if the bot is faulty or if there is an issue with the addressing of the SPAN element.

Here is part when I address the field in the bot:

imageDomXPath:

imageand this is the variable I enter in the field over a key stroke:

imageI checked over a message box if all information are in the variable and I can confirm that.

 

Can someone please advise in that matter?

 

Thank you vor your time an help in advance

 

Cheers

 

Chris


6 replies

Userlevel 3
Badge +7

Hi @Christian Lichter​ ,

 

Could you try using the Object Cloning itself to set text instead of relying on Keystrokes?

Also, I'd recommend refining the XPath a bit more.

We can help you with refining the XPath if you can paste the inspection details here i.e., Right-Click -> Inspect -> Element you wish to interact with.

 

Kind Regards,

Ashwin A.K

Hi Ashwin,

 

thank you for your answer.

Unfortunately it is not possible to set text in the text field with Object cloning. That option is not given when I try to clone the object. That was also the reason that I used key strokes.

 

In regards of refining the xPath, can you give more background, as I don't have more inspections details as I have posted already in my first post under the Headline DomXPath?

 

Thank you very much indeed for your help.

 

Cheers

 

Chris

Hi Ashwin,

 

just in case you meant to inspect in the browser for the element hier the screen shot from the browser once with date in the addressed text field:

 

image 

and once without data in the text field

 

image 

Cheers

 

Chris

 

 

Hi @Christian Lichter​,

 

Can you try to add some delays in Keystrokes command ? such as 1000ms, 2000msScreenshot 2022-02-20 183325 

Regards,

Karthik R

Userlevel 3
Badge +7

Hi @Christian Lichter​ ,

 

Thank you for your response.

To answer your question, XPaths are what the bot uses to detect elements on a webpage. You can think of them as unique locators crafted out of the DOM or the HTML that makes up the entire website.

 

If I were in your situation, I would try to find a link between the Invoice Number field, and the field that I wish to enter data into.

 

This, as you can imagine, is a little tricky since we have to pinpoint two nodes - one responsible for housing the Invoice Number field, and the other for the empty field to enter data into and combine the two.

 

For starters, here is a series I have penned on the subject of XPaths.

 

Kind Regards,

Ashwin A.K

Hi Karthikr27,

thank you for your answer.

Regarding the delays, this is already, exessively, done without any effect of the strange behaviour.

Inside the Keystroke request and outside:

 

Please see screen shot:

 

Inside keystroke:

 

image 

And outside:

 

image 

Any other ideas?

 

Thank you again!

 

Chris

Reply