I am experiencing an issue with removing text from a text box on a web page. I created a loop which takes a company code from an Excel row (company code.tostring), enters it into the website, looks for the data, scrapes the data and then is supposed to remove the company code and enter a new company code. In order to remove the company code I tried using type into: empty field with “” as type into field and sending a ctrl+a (with empty field box ticked also tried without this box ticked but still doesn’t work) and del hotkey. However, both don’t work as they don’t always remove the full company code - sometimes 00’s are left. Additionally, after entering the first company code it removes the company code fine but then on the second company code the removing does not work.
Thanks for your quick response, as stated above, I have tried that solution before, somehow it does not remove any of the text but just leads to accumulating the company codes see image below. So unfortunately that does not work.
I have a doubt, does it work when you do it manually i.e., can you empty that field by using prompts ctrl+A and delete ?
Because it may be “read only” field or that text box might be coded in such a way that it might not be able to delete the content of the field.
Also, can u confirm me while u are using typeinto activity in Properties panel is the “simulate type” checked or un-checked?
Thaks for your reply, none of these options are working unfortunately. Could you please elaborate on injecting the JS code to browser and set the value, I am not sure if I understand what you mean by this. The thing is that my sequence has two if/then situations. For the first five company codes where a company code can be found, the data is scraped and added to an excel file and then the company code is removed and the next one is entered. However, at some point there are company codes which the website cant find, which in essence is not a problem, but this is where the deleting of the company codes becomes an issue. Eventhough this process is in principle the same for the first company codes, but somehow then it stops working, its also where the seeking of the company code and the data scraping stops working. See below images of my sequence, perhaps you guys know where the problem is? I’ve spent three days on this but cant figure it out.
I have a similar problem to @Merel as you can see here:
I try different solutions, unsuccessfully.
To summarize, I have a text field in a web application window (as you can see below) with a lot of paragraph and I need to remove one according to a condition. However, when I try to remove it, he doesn’t work.
I used get full text activity for the complete text (Variable1) and get text activity to my paragraph of interest (Variable2) and then I try different solution:
1- Assign Variable1 = Variable1.Remove(Variable2, “”) but the modification is do only in my variable1, not in the text field of the web page.
2- Assign Variable1 = Variable1.Replace(Variable2, “”), same result to the first one
3- Assign Variable3 = Variable1.Remove(Variable2, “”), same result to the first one
4- Send Hotkey with “ctrl + a” and then send hotkey with “back”, but he do on the web page, not in the text field of the web page, however it’s in a element scope activity (of text field)
So if you know an other issue to accomplish successfully this step of my process, that will be great.
Sure I check Empty field in my type into. I tried too with send hotkey activity, I can to select with Ctrl + A after a click but I can’t to delete or cut to paste then my variable
I let you know.
In fact, I can to select the text with “Ctrl + a” but when I add then a send hotkey with “Del”, “Back” or “Ctrl + x”, the bot doesn’t work as if I add only a send hotkey with “Ctrl + a”. So it’s very strange.
In addition, Send hotkey with “Ctrl + v” don’t work too.
And it’s the same with type into activity.
Thanks @loginerror, unfortunately I took that for both methos (as you can see below for the 1st method):
And “back” with send hotckey work on the page so instead off to delete the text, the bot go to the previous page. So I tried with “del” send hotkey, but no modification.
I precise that it’s possible to do all that manually, so I don’t understand why with the bot it’s nos possible in this case. Do you think that it could be due to a security or something like that?
In this case, I would try to build from a small example. Start by opening your page and doing actions within one Open Browser or Attach Browser activity. Let’s debug if the Element Scope is at fault here.
Here’s my suggestion. Have the website open with text selected and then run a bot that is only supposed to:
Attach Browser activity to that open window
Send Hotkey back as a special key with a selector pointed to the text box.
The result is the same that before and I select the text field and here you are the selector and when I select with Uiexplorer. I have the impression of that there is not a lot of elements in the right part.