How i can verify second browser tab elements and switch back to first browser tab
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How i can verify second browser tab elements and switch back to first browser tab
Hi,
I am working with complete descriptive . Below is my sample code
Browsers.Item(btChrome).Run("URL")
Set oBrowser = Sys.Browser("*")
Set oPage = oBrowser.Page("*")
Set obj= oPage.Find(arrPropNames, arrPropValues, 90, True)
If obj.Exists Then
obj.Click
end if
everything is working perfect if i am on single browser window . There is one scenario where if i click link it will open one more window where i need to validate some elements and switch back to first one for further validation
.Find not able to recognize objects in second browser window
Note :
1.URL is dynamic so i cant use url while creating page object
any better suggetion without using URL as property
2. I should not use name mapping
in UFT we have creationtime so we can easily do that but in testcomplete so many complications
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
> Set oBrowser = Sys.Browser("*")
> Set oPage = oBrowser.Page("*")
On the human language the first line means this: "Search for any browser running in the system and use the found one from this point on".
The second line means this: "Using the browser found on the previous step, get any page opened in it and use this page from this point on".
Considering the above, I hope that it is obvious that some other but not expected browser and page can be found and used when more than one browser with more then one page are open in the system.
You need to provide exact identification criteria to command TestComplete to search for and use the object that you need for your test.
/Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for reply. Your correct
Is there any way without using below lines .
So that I can test multiple browser page validation
Set oBrowser = Sys.Browser("*")
Set oPage = oBrowser.Page("*")
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
> Is there any way without using below lines .
Not sure I got the question...
In order for the tool to be able to work with browser and web page they must be somehow specified. The way of specification depends on the tool. As you said, for UFT it is possible to use some property that specifies when the given programmatic object was created.
TestComplete tries to mimic human user as much as possible. Thus the preferred way of addressing objects for TestComplete is to use those properties that the human end user works with.
Consider the following manual scenario: I started this test and proceeded to the point where I have two pages opened in the browser. Then I had to switch to do something else and asked you to continue the test.
Will you deal with creationtime? I bet no. You just will have nothing like that. Will you be able to identify the browser to use, the initial page and second spawned one? I am pretty sure that yes. How will you be able to identify them? Consider how you will do this manually and implement the same logic/identification attributes in your automated code.
/Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @saleem1990,
Was the issue resolved? Please share the solution you decided to use.
Tanya Yatskovskaya
SmartBear Community and Education Manager
