How to Click on Back Button from IE Browser ??

Ask general questions here.
rahulguptab4u85
Posts: 1
Joined: Fri Jun 03, 2016 4:28 am

How to Click on Back Button from IE Browser ??

Post by rahulguptab4u85 » Fri Jun 03, 2016 4:39 am

Hi,

How to Click on Back Button from IE Browser ??

There is a scenario wherein I have to click on Back button from the IE browser to check some condition.

Can anyone share the code?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How to Click on Back Button from IE Browser ??

Post by Support Team » Mon Jun 06, 2016 10:18 am

Hi rahulguptab4u85,

On way would be to record the corresponding mouse click action on the back button.
mouse_click_back.png
The corresponding code for clicking the back button:

Code: Select all

repo.InternetExplorerForm.Back.Click();
Alternatively, you could use JavaScript to perform a variety of actions on the DOM-element.

Reload web page

Code: Select all

repo.Dom.Self.ExecuteScript("location.reload();");
Navigate to the previous page

Code: Select all

repo.Dom.Self.ExecuteScript("history.back();");
Navigate forward

Code: Select all

repo.Dom.Self.ExecuteScript("history.forward();");
I hope this information will help you.

Sincerely,
Johannes
You do not have the required permissions to view the files attached to this post.