Sagittarian
Sagittarian

Reputation: 9

Unable to access button in different frame in a web page using vbscript in uft

I am not able to access a button in a different frame. The part of HTML code for button is:

<input value=" New " class="btn" type="button" name="newAcctButton">

For the frame is:

<iframe frameborder="0" height="6500px" id="itarget" name="itarget" scrolling="auto" src="/servlet/servlet.Integration?lid=01NA0000000aPXG&amp;enc=UTF-8&amp;ic=1" title="Content" width="100%"></iframe>

I am trying that standard format Browser(browsername).Page(pagename).Frame("name:=itarget").getElementByName("newAcctButton").Click

I know this can be easily handled using Record and Playback functionality in QTP.

Is it possible to switch to different frame (like we do in selenium webdriver) and access the web button?

Upvotes: 0

Views: 2084

Answers (1)

vins
vins

Reputation: 15370

There is no getElementByName method in UFT unless you would like to use native object events.

It Should be like this.

Browser(browsername).Page(pagename).Frame("name:=itarget").WebButton("name:=newAcctButton").Click

Upvotes: 1

Related Questions