Adam Sh
Adam Sh

Reputation: 8577

Replace all words in eclipse with variable

I have a project with many classes.

I wish to replace this command:

a.Dosomething();

by this one:

((JavascriptExecutor) driver).executeScript("click();", a);

(when a in the first command is the same in the second)

I read this answer: Eclipse Replace text in all Classes?

But this is not possible with variable. There is a easy way to do it?

Upvotes: 2

Views: 251

Answers (2)

Strinder
Strinder

Reputation: 2240

Use a text editor like Ultraedit, PSPAd, Notepad++ and look in the help for the replace feature of it. Usually it supports regular expressions...

Upvotes: 0

PrincessLeiha
PrincessLeiha

Reputation: 3174

If I am getting your question right, you just want to replace all occurrences of a.Dosomething(); with ((JavascriptExecutor) driver).executeScript("click();", a);.

You can try using "Search"-> "File..."-> Enter the text you want to in Containing text:

set the File Name Pattern to *.

Set Scope to Worskpace

then hit Replace... you can enter your new text. You can also Preview all the places that will be affected. Finally hit OK.

Upvotes: 2

Related Questions