Open Browser Activity - Can we open a browser in a for each loop only once?


#1

Can I open a browser only once even if I am in a for each loop


#2

For the first time you need to open browser outside for loop then create a browser variable,Then inside for loop check, if the browser exists, else open browser @prankurjoshi

thanks,
Sreekanth.k


#3

What you mean “only once?” it means 1si time ?


#4

Yes only 1st time and after that through the loop we can navigate to some url in same browser


#5

But after opening a browser I need to open an excel sheet, so by doing that the control of cursor goes to excel instead of browser. Because after opening excel I need to work on Browser only, so can we bring browser on top


#6

@prankurjoshi use a click activity on top of browser and check simulate type after reading excel so that browser will be on top
Thanks,
Sreekanth.k


#7

will u be more specific?


#8

Like @sreekanth mentioned, you can open it first with Open Browser, then reuse it later with Attach Browser.

Example:
Browser for Once.zip (11.1 KB)


#9

@Manjuts90 definitely follow @whyyouandi’s advice and set/use the Browser variable but if you’re only reading/writing to Excel and using .xlsx you can also turn off visibility in your Excel Application Scope options and it won’t display over top of your browser.