1

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?

Community
  • 1
  • 1
Adam Sh
  • 8,137
  • 22
  • 60
  • 75

2 Answers2

1

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.

PrincessLeiha
  • 3,144
  • 4
  • 32
  • 53
0

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

Strinder
  • 2,111
  • 2
  • 21
  • 34