How to find search text box on the page and write value in it?

A page opens up and it must have a search text box.
what is the way to doing this?
guide me please.

Scenario is
site opens up.
if find
xpath=//td/div/input
then type “page testing” and press enter
(if it is not then)

if find
xpath=//td[2]/div/input
then type “page testing” and press enter
(if it is not then)

if find
xpath=//td[3]/div/input
then type “page testing” and press enter
(if it is not then)

if find
xpath=//td[4]/div/input
then type “page testing” and press enter
(if it is not then)

if find
xpath=//td[5]/div/input
then type “page testing” and press enter
(if it is not then)

You can use verifyElementPresent: assertElementPresent, assertElementNOTPresent, verifyElementPresent (assert Element Present, assert Element NOT Present) - Selenium IDE Commands Tutorial

if_v2: If, else if, else, end => Flow Control - Selenium IDE Commands Tutorial

type: sendKeys and Type - Selenium IDE Commands Tutorial

The main docs are here: UI Automation Open-Source Selenium IDE plus additional features, iMacros alternative

Thanks for reply @user9898

i am able to find the xpath on the page. but the trouble for me is-
how to find that which xpath is available on the page. if xpath2 is there then no problem for me. but i am stucking up when i made script of xpath2 but on the page it has xapth4.
i am struggling in it.

I’m not sure I understand. It sounds like you just want multiple conditionals?

i searched and found that
if
else if
else if
else if
elseif
will solve this but dont know how to do it?

https://ui.vision/rpa/docs/selenium-ide/if

i am posting here the stuff after reading the things in forum.
how to put it in it?

I know its a 2 min task for developer. i wish i could be a developer?

@admin
there must a checkbox available next to the post, if it gets selected Then developers can get to know that this problem came from non programmer background.

from the bottom of my heart , Thank you and appreciate the time and solution from the genius programmers of the Kantu Family but it would be more good if that is solving the exact problem too.

You would use:

if
elseif
elseif
else
end

Thanks again. You must be a genuine developer. See frankly speaking i dont know how to write code.

May i request you to pl. write few lines for me. If possible.
Thanks for your reply, support and time.
sg

I suggest you to think a better solution, this is often complex codes in macros can give errors or freezes so I always advise you to think of a simple and clear way to create a short and simple macro code.

@newuserkantu
you may be right.

May be admin will help me.
He is kind and genius too. He always listen and understand what the people are facing and more is he is ready with the solution too.
May be we all are / can be their enterprise customer in future too.
Thanks in advance @admmin and @ulrich

I used for 10 years imacros, and i use from 1 year Ui vision, the best way to create one automation is create simple and short code, other solution can create problems.

For every automation there are more way to create a macro.

A simple and short code is easy to edit and fix and executed for limited time and this prevent error and bug.

I rewrited all my macros in this mode and now working all.

see every one is working and fulfilling their need as per their requirement. and if we stucks up somewhere then we are asking help only and expecting to fulfilling in timely and in short period. Discussion can go long but the most importing part is Do i am or my statement is the part of the solution? If it is not then i am the problem.
@admin Is there any chance or way if i paid for it, and i get the code?
I am sure you must have something fruitfill.

Scenario is
In any case there must be a “TextBox” is on the screen. either 1 / 2 or 3

site opens up.
if find
xpath=//td/div/input (TextBox1)
then type “page testing” and press enter
(if it is not then)

if find
xpath=//td[2]/div/input (TextBox2)
then type “page testing” and press enter
(if it is not then)

if find
xpath=//td[3]/div/input (TextBox3)
then type “page testing” and press enter

I cant share the my applicaiton stuff here but here is the falvour

EG.

xpath=(//input[@type=‘text’])[2]
xpath=(//input[@type=‘text’])[3]
xpath=(//input[@type=‘text’])[4]

in my application if any page opens up then there is one text field either it could be any from above.

What is your problem ?

I see a partial code and i do not see a complete log to search error.

if you have went through with it you must be knowing that There is no code here.

admin can you pl. help me?

I feel your frustration. You have already written the logic in pseudocode, you should now attempt to write it in working code using the links provided above as help, then come back with specific errors if it doesn’t work.

I believe the help pages cover most if not all of what you’re asking. I would suggest using the following as a starting point, and change it for your needs:

If Example

The example macro tries a second link if the first one is not found. Best if you see the flow logic in action by running the DemoIfElse macro that installs with the IDE.

Command Target Pattern/Text
store true !errorIgnore
click link=helloworld
If_V2 ${!LastCommandOK}
click link=anotherLink
else
echo The first link was found
end

If you change ‘click’ for ‘assertElement’, and put your xpath in Target, then change ‘click’ for ‘type’ (again, edit Target for your needs), you should hear the penny drop and see where to go.

Hope that helps.

many thanks for your reply but sorry again.
I dont know how to fit it in my scenario.
I think i have requested a sever kind of code where no admin and genius coder can write the code.
Now i can understand the world is only for the coders.

Any way, Many Thanks for all for their time help and support. I apologize for my this post.

BUT i wish that all Kantu family and their family members will not face this kind of situation anywhere in life.
May God Bless you all.

???

You can hire a freelancer to develop your project: